Pure ASP Upload 2 Support Product Page

This topic is locked
This topic was archived

UploadFormRequest not working

Asked 16 Jul 2007 16:07:34
1
has this question
16 Jul 2007 16:07:34 Jih Ying Tioh posted:
Hi George,

I've used UploadFormRequest() before and it worked with older versions of PAU.

But with PAU2.2.2 it doesn't seem to work no matter where I include the UploadFormRequest. E.g.

<%
'*** Pure ASP File Upload 2.2.2
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 = """cv/"""
pau_Extensions = "doc,pdf,rtf,txt"
pau_Form = "vacancy"
pau_Redirect = "includes/vacancyScript.asp"
pau_storeType = "file"
pau_sizeLimit = "2000"
pau_nameConflict = "uniq"
pau_requireUpload = "true"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = ""
pau_progressWidth = "300"
pau_progressHeight = "100"

<b>Session("File" = UploadFormRequest("File"</b>

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.22
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
%&gt;

Replies

Replied 16 Jul 2007 16:20:13
16 Jul 2007 16:20:13 Georgi Kralev replied:
Hi Jih,

The way you use UploadFormRequest is inappropriate.

In order to work the line:
Session("File" = UploadFormRequest("File"

should be after the code of Pure Asp Upload (not within it).
For exmaple:

&lt;%
'*** Pure ASP File Upload 2.2.2
......

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.22
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
%&gt;

&lt;% Session("File" = UploadFormRequest("File" %&gt;

Regards,




Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 16 Jul 2007 16:46:37
16 Jul 2007 16:46:37 Jih Ying Tioh replied:
Hi George,

I've tried that as well. At different position. But it still doesn't work. E.g.

&lt;%
'*** Pure ASP File Upload 2.2.2
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" 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 = """cv/"""
pau_Extensions = "doc,pdf,rtf,txt"
pau_Form = "vacancy"
pau_Redirect = "includes/vacancyScript.asp"
pau_storeType = "file"
pau_sizeLimit = "2000"
pau_nameConflict = "uniq"
pau_requireUpload = "true"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = ""
pau_progressWidth = "300"
pau_progressHeight = "100"

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.22
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
%&gt;
&lt;%
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Session("File" = UploadFormRequest("File"
End If
%&gt;
Replied 16 Jul 2007 17:14:25
16 Jul 2007 17:14:25 Georgi Kralev replied:
Jih,

Your code should work without any problem.
Please, provide the entire page so I can examine the problem.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 16 Jul 2007 20:11:17
16 Jul 2007 20:11:17 Jih Ying Tioh replied:
Hi George,

I think I know why it fails.

I'm using a redirect page to show the session variables. I don't know why the session variables are not stored before redirection.

I've managed to overcome the problem by setting the redirection page to nothing and then use response.redirect to redirect after defining the session variables.

Thanks.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Jih,

Your code should work without any problem.
Please, provide the entire page so I can examine the problem.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 17 Jul 2007 11:19:09
17 Jul 2007 11:19:09 Georgi Kralev replied:
Hi Jih,

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I think I know why it fails.

I'm using a redirect page to show the session variables. I don't know why the session variables are not stored before redirection.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Yes, this is the problem. If you use the redirect of Pure Asp Upload it will happen after the upload and all the code after ProcessUpload will not be executed.

The solution is the one you did. To use Response.Redirect after the code which needs to be executed.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com

Reply to this topic