I try to use script from www.freeaspupload.net for upload file.
I need to store in session object the names of uploaded files but I get an
error - Cannot use Request.Form collection after calling BinaryRead
How can I make it?
Part of this script:
<form name="frmSend" method="POST" enctype="multipart/form-data"
action="upload_file.asp" onSubmit="return onSubmitForm();">
<span>File 1 :</span> <input type="file" name="file" size="35"
class="form"><br><br>
<span>File 2: </span><input type="file" name="file_2" size="35"
class="form"><br><br>
<input type="submit" value="Submit" class="form">
</form>
....
..
....
<%
function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function
SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & ""
next
else
SaveFiles = "no file."
end if
end function
Session("file") = SaveFiles
'#### ###
Session("file") = Trim(Request.Form("file"))
Session("file_2") = Trim(Request.Form("file_2"))
'#### ###
Thx for help