Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: upload.form

  1. #1
    New Coder
    Join Date
    Jun 2002
    Thanked 0 Times in 0 Posts


    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

  2. #2
    Senior Coder
    Join Date
    Dec 2002
    Arlington, Texas USA
    Thanked 11 Times in 11 Posts
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts