Forums

This topic is locked

ASP Upload 2.13 - Filename to session

Posted 29 Apr 2003 23:10:52
1
has voted
29 Apr 2003 23:10:52 Robert Kruse posted:
The code in this new ASP Upload 2.13 update has changed a lot - The instructions for setting a session variable from the "Filename just uploaded" seem obsolete. They say to add a snippet of code at the end of the upload code. Well, Where? And at the end of which code?

Excerpt from the instructions, that doesn't tell you where EXACTLY to put the code
-----------
Q: How can I store the filename of the uploaded file in a session variable?

I simply want the files to be uploaded and filenames stored in session variables, no need to insert in a database table.

A: Storing the filenames in session variable is easy:

Session("filename1" = UploadFormRequest("filename1"

but you should do this only when the upload is in process so:

If (CStr(Request.QueryString("GP_upload") <> "" Then
Session("filename1" = UploadFormRequest("filename1"
Session("filename2" = UploadFormRequest("filename2"
end if

Add this code at the end of the upload code

filename1 and filename2 are the form upload field name
------------

Thanks.

Replies

Replied 30 Apr 2003 12:35:58
30 Apr 2003 12:35:58 Angus Halliday replied:
You put it right at the end of the code block;

i.e. code in red


'*** Pure ASP File Upload 2.1.3
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """../content/uploads"""
pau_Extensions = ""
pau_Form = "form1"
pau_Redirect = ""
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "error"
pau_requireUpload = "true"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = "fileCopyProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.13
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
<font color=red>If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Session("svFilename" = UploadFormRequest("sfilename"
End If
</font id=red>



Reply to this topic