ENCTYPE and Response.Form.Item(...) conflict?

Discussion in 'ASP General' started by nick, Jun 8, 2005.

  1. nick

    nick Guest

    I have an simple ASP form and I am using the following statement to get the
    values:

    emailFrom = Request.Form.Item("ctrl:EmailFrom")
    emailTo = Request.Form.Item("ctrl:EmailTo")

    However, after I added attribute ENCTYPE="multipart/form-data" to the HTML
    tag <Form> for uploading files (not implemented yet). The above code doesn't
    work and the value of Request.Form.Item("...") become "Undefined".

    How to solve the problem? Thanks.
     
    nick, Jun 8, 2005
    #1
    1. Advertising

  2. nick wrote:
    > ...after I added attribute ENCTYPE="multipart/form-data" to the
    > HTML tag <Form> for uploading files (not implemented yet). The above
    > code doesn't work and the value of Request.Form.Item("...") become
    > "Undefined".


    Consider this:
    http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html#form-content-type

    [multipart/form-data]

    The content "multipart/form-data" follows the rules of all multipart
    MIME data streams as outlined in [RFC2045]...

    A "multipart/form-data" message contains a series of parts, each
    representing a successful control. The parts are sent to the
    processing agent in the same order the corresponding controls appear
    in the document stream...

    Each part is expected to contain:
    1. a "Content-Disposition" header whose value is "form-data".
    2. a name attribute specifying the control name of the
    corresponding control...

    Thus, for example, for a control named "mycontrol", the corresponding
    part would be specified:

    Content-Disposition: form-data; name="mycontrol"

    As with all MIME transmissions, "CR LF" (i.e., `%0D%0A') is used to
    separate lines of data.



    Take a look here. The devil is in the details.
    http://msdn.microsoft.com/library/en-us/dnasdj01/html/asp0900.asp


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jun 9, 2005
    #2
    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,145
    softip
    Feb 27, 2009
  2. Matt
    Replies:
    8
    Views:
    144,673
    zeeshanakhter2009
    May 26, 2012
  3. Duncan
    Replies:
    0
    Views:
    1,532
    Duncan
    Feb 24, 2006
  4. Matt
    Replies:
    1
    Views:
    11,301
    David Dorward
    Oct 12, 2004
  5. Stimp
    Replies:
    1
    Views:
    935
    Karl Seguin [MVP]
    Nov 9, 2006
Loading...

Share This Page