View Full Version : upload.form

03-14-2006, 05:30 PM
I have a file upload form with the following form

<form method="POST" enctype="multipart/form-data" action="Insert.asp">
<input type="hidden" name="user" value="<%=request("user")%>" />
<input type="hidden" name="policy" value="<%=request("policy")%>" />
<input type="file" name="file" /><input type="submit" name="Submit" value="Submit" class="bodytext">

in the insert page i submit the file but when I try to redirect when finshed to a page using the user and policy values it failed. I found out that i need to use upload.form not request("value") but I am still getting an error...
the redirect is:

Response.redirect "index.asp?user="& Upload.form("user")&"&policy="& Upload.form("policy") &""

the error is object required " at the above line

can anyone see why

03-14-2006, 11:40 PM
Without seeing the code that is on the page, I would have to ask did you close the upload object before that line of code? My guess is yes, you did.

Also you will have better performance to not go through the upload collection multiple times. Declare some variables and assign the values form the upload collection to them, then use the variables in the places where you have upload.form("")

Dim sUser, sPolicy
sUser = upload.form("user")
sPolicy = upload.form("policy")

Response.redirect "index.asp?user="& sUser & "&policy=" & sPolicy