[thelist] multipart/form-data (was: File button)

Lee kowalkowski lee.kowalkowski at googlemail.com
Wed Nov 8 17:07:35 CST 2006


On 07/11/06, Julian Rickards <julian.rickards at gmail.com> wrote:
> If you have a form in which you may add some text and
> upload a file, such as a photo with a description of it, how do you upload
> both? It is my understanding that a form with text in it must be submitted
> with enctype="application/x-www-form-urlencoded" (or nothing at all which
> will default to this) and a form with a file upload must be submitted with
> enctype="multipart/form-data". Are these incompatible by which I mean, can
> you submit a form with enctype="multipart/form-data" with both text
> (textfield, radio buttons, checkboxes...) and a file upload at the same
> time?

You should be able to:
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2.  Each form
field becomes an individual part.

That's the theory over with, it can be trickier in practice, depending
on what server-side technology you're using, you might need to bolt
extensions on to some frameworks to handle the file upload, but the
text parameters are usually fetched as in normal posts, so the
combination should be dealt with transparently.

-- 
Lee



More information about the thelist mailing list