For Programmers: Free Programming Magazines  


Home > Archive > ASP > June 2005 > ENCTYPE and Response.Form.Item(...) conflict?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2005-06-08, 3:55 am

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.
Dave Anderson

2005-06-09, 3:55 pm

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-html4...rm-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/e...tml/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.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com