How to integrate the UploadRequest Class into an existing project in three easy steps:
1) Add the following
value to the FORM tag:
ENCTYPE="multipart/form-data"
2) Add the following to the ASP file that the form is posting to (ACTION):
Dim
objUploadRequest :
Set objUploadRequest = New UploadRequest
'Initialize and configure
With objUploadRequest
.UploadLimit = 1000000 'File size limit in Bytes
.UploadFolder = "Uploaded/"
.Verbose = 1 'Display info about uploaded file(s): 0 = No / 1 = Yes
.RandomName = 0 'Generate a unique name for uploaded file, extension is kept:
0 = No / 1 = Yes
.UploadPrefix = "" 'Prefix for value names of uploaded
files, example: "Uploaded/"
End With
'Process upload request (save files and store POST variables)
Call objUploadRequest.Process()
'[FURTHER PAGE PROCESSING GOES HERE]
'Clean up
Set objUploadRequest = Nothing
3) After uploading a file, you cannot access the "Request" object in order
to process POST variables anymore, so to avoid affecting the existing functionality
of your page do the following:
Replace "Request(" or/and "Request.Form(" with "objUploadRequest.GetValue("