[thelist] ASPUpload: using dynamic path name [Resolved; Solution]

webdev EvoltList at no-pun.com
Wed Apr 2 11:27:58 CDT 2008

A couple of you pointed out bone-headed oversights (reversed slash; and
extraneous quotes).  Thank you for that. But, did not ultimately resolve the 
issue.  But, I did figure out the hack, with a little help from a forum note 
at 15seconds.

The fix was elusive (and there is a least one kludgy alternative  -- of 
saving then moving files -- floating around), so I will report my solution 
here for archival purposes.

- Because of the enctype="multipart/form-data" nature of the ASPUpload form, 
you cannot use your good ol'  "Request.Form" collection.
- And, you cannot use the ASPUpload "Upload.Form" collection until after the 
"Upload.Save" (which sets the upload destination path).
- So, you need to append the ASPUpload form action with your dynamic path 
- To do so, you need to create a "pre-form" that passes that path variable 
onto the ASPUpload form, where it is dynamically written into the form 

If anyone is interested in the full code, from all files, feel free to email 
me offlist.

Here is the revised code (as posted):

 Dim Upload, Count, Item, strDropForm, strThisDropFolder, strDropFolderPath
 Set Upload = Server.CreateObject("Persits.Upload.1")

 strThisDropFolder = Request.Querystring("ThisDropFolder")

' response.write strThisDropFolder

 Upload.OverwriteFiles = True
 'On Error Resume Next

 strDropFolderPath = "d:\hshome\etchart\wallpaperforwindows.com\Products\" & 

 Upload.SetMaxSize 1048576 ' Limit files to 1MB
  Count = Upload.Save(strDropFolderPath)


More information about the thelist mailing list