ASP, multipart/form-data encoding

Discussion in 'ASP .Net' started by Jon Petrak, Mar 1, 2004.

  1. Jon Petrak

    Jon Petrak Guest

    I'm sorry if this is the wrong newsgroup, but the ASP ones seem to be
    devoid of any talk about ASP (and rather filled with spam).

    I have a very simple form here that loops back into upon submission:

    All I'm trying to do is test that the hidden field is passing properly (it's
    not). It works fine when I remove the encoding property from the FORM tag,
    but I need it to build a file upload component. I've noticed quite a few
    messages on various newsgroups and forums regarding this issue, but none
    seem to have an answer..
    <% option explicit %>
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <% Response.Write("Hidval: " & request.Form("hidval")) %>
    <form action="upload.asp"
    enctype="multipart/form-data" method="post"
    name="f" id="f">
    Pick a file to upload:<br />
    <input type="file" name="test" size="50" ID="File1"/>

    <input type="hidden" name="hidval" value="test">
    <input type="submit" value="submit" ID="Submit1" NAME="Submit1"/>
    </form>
    </body>
    </html>I've been messing with this all day without luck, any insight would
    be greatly appreciated!
     
    Jon Petrak, Mar 1, 2004
    #1
    1. Advertising

  2. Hi, Jon Petrak,

    Most probably it is the parser that doesn't parse correctly the posted data.
    As I don't have some code to check, could you try moving the hidden before
    the input type=file control and then testing the value in the second page.

    Hope this helps
    Martin
    "Jon Petrak" <> wrote in message
    news:gQD0c.40514$A12.30527@edtnps84...
    > I'm sorry if this is the wrong newsgroup, but the ASP ones seem to be
    > devoid of any talk about ASP (and rather filled with spam).
    >
    > I have a very simple form here that loops back into upon submission:
    >
    > All I'm trying to do is test that the hidden field is passing properly

    (it's
    > not). It works fine when I remove the encoding property from the FORM tag,
    > but I need it to build a file upload component. I've noticed quite a few
    > messages on various newsgroups and forums regarding this issue, but none
    > seem to have an answer..
    > <% option explicit %>
    > <html>
    > <head>
    > <title>Test</title>
    > </head>
    > <body>
    > <% Response.Write("Hidval: " & request.Form("hidval")) %>
    > <form action="upload.asp"
    > enctype="multipart/form-data" method="post"
    > name="f" id="f">
    > Pick a file to upload:<br />
    > <input type="file" name="test" size="50" ID="File1"/>
    >
    > <input type="hidden" name="hidval" value="test">
    > <input type="submit" value="submit" ID="Submit1" NAME="Submit1"/>
    > </form>
    > </body>
    > </html>I've been messing with this all day without luck, any insight would
    > be greatly appreciated!
    >
    >
    >
     
    Martin Dechev, Mar 1, 2004
    #2
    1. Advertising

  3. Jon Petrak

    Jon Petrak Guest

    Tried that, with no luck. Going to take a look at the http headers to see if
    I can narrow this down any.

    "Martin Dechev" <> wrote in message
    news:OJavti4$...
    > Hi, Jon Petrak,
    >
    > Most probably it is the parser that doesn't parse correctly the posted

    data.
    > As I don't have some code to check, could you try moving the hidden before
    > the input type=file control and then testing the value in the second page.
    >
    > Hope this helps
    > Martin
    > "Jon Petrak" <> wrote in message
    > news:gQD0c.40514$A12.30527@edtnps84...
    > > I'm sorry if this is the wrong newsgroup, but the ASP ones seem to be
    > > devoid of any talk about ASP (and rather filled with spam).
    > >
    > > I have a very simple form here that loops back into upon submission:
    > >
    > > All I'm trying to do is test that the hidden field is passing properly

    > (it's
    > > not). It works fine when I remove the encoding property from the FORM

    tag,
    > > but I need it to build a file upload component. I've noticed quite a few
    > > messages on various newsgroups and forums regarding this issue, but none
    > > seem to have an answer..
    > > <% option explicit %>
    > > <html>
    > > <head>
    > > <title>Test</title>
    > > </head>
    > > <body>
    > > <% Response.Write("Hidval: " & request.Form("hidval")) %>
    > > <form action="upload.asp"
    > > enctype="multipart/form-data" method="post"
    > > name="f" id="f">
    > > Pick a file to upload:<br />
    > > <input type="file" name="test" size="50" ID="File1"/>
    > >
    > > <input type="hidden" name="hidval" value="test">
    > > <input type="submit" value="submit" ID="Submit1" NAME="Submit1"/>
    > > </form>
    > > </body>
    > > </html>I've been messing with this all day without luck, any insight

    would
    > > be greatly appreciated!
    > >
    > >
    > >

    >
    >
     
    Jon Petrak, Mar 1, 2004
    #3
  4. Jon Petrak

    Jon Petrak Guest

    For future reference, the issue was that ASP does not natively support that
    encoding type and the data has to be parsed manually.

    "Jon Petrak" <> wrote in message
    news:goO0c.40771$A12.13383@edtnps84...
    > Tried that, with no luck. Going to take a look at the http headers to see

    if
    > I can narrow this down any.
    >
    > "Martin Dechev" <> wrote in message
    > news:OJavti4$...
    > > Hi, Jon Petrak,
    > >
    > > Most probably it is the parser that doesn't parse correctly the posted

    > data.
    > > As I don't have some code to check, could you try moving the hidden

    before
    > > the input type=file control and then testing the value in the second

    page.
    > >
    > > Hope this helps
    > > Martin
    > > "Jon Petrak" <> wrote in message
    > > news:gQD0c.40514$A12.30527@edtnps84...
    > > > I'm sorry if this is the wrong newsgroup, but the ASP ones seem to be
    > > > devoid of any talk about ASP (and rather filled with spam).
    > > >
    > > > I have a very simple form here that loops back into upon submission:
    > > >
    > > > All I'm trying to do is test that the hidden field is passing properly

    > > (it's
    > > > not). It works fine when I remove the encoding property from the FORM

    > tag,
    > > > but I need it to build a file upload component. I've noticed quite a

    few
    > > > messages on various newsgroups and forums regarding this issue, but

    none
    > > > seem to have an answer..
    > > > <% option explicit %>
    > > > <html>
    > > > <head>
    > > > <title>Test</title>
    > > > </head>
    > > > <body>
    > > > <% Response.Write("Hidval: " & request.Form("hidval")) %>
    > > > <form action="upload.asp"
    > > > enctype="multipart/form-data" method="post"
    > > > name="f" id="f">
    > > > Pick a file to upload:<br />
    > > > <input type="file" name="test" size="50" ID="File1"/>
    > > >
    > > > <input type="hidden" name="hidval" value="test">
    > > > <input type="submit" value="submit" ID="Submit1" NAME="Submit1"/>
    > > > </form>
    > > > </body>
    > > > </html>I've been messing with this all day without luck, any insight

    > would
    > > > be greatly appreciated!
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Jon Petrak, Mar 5, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Li Zhang
    Replies:
    4
    Views:
    6,141
    softip
    Feb 27, 2009
  2. Dema
    Replies:
    3
    Views:
    353
  3. Stefan Fischer
    Replies:
    2
    Views:
    358
    Stefan Fischer
    Feb 23, 2010
  4. Kevin DeValck
    Replies:
    1
    Views:
    779
    7stud --
    May 17, 2011
  5. Replies:
    1
    Views:
    464
Loading...

Share This Page