views:

493

answers:

4
+4  Q: 

html form enctype

In HTML forms containg file uploads, enctype="multipart/form-data" attribute has to be set. This much I know. But why? What exactly does it change? How does it differ from application/x-www-form-urlencoded?

+2  A: 

Here's the W3C doc on both items. It's pretty dry but it can help some.

Ólafur Waage
+1  A: 

The default encoding of appliaction/x-www-form-urlencoded can't send a) large quantities or binary data or b) text containing non-ASCII characters. That's why you need to set it to multipart/form-data for file uploads.

Sohnee
+1  A: 

A multipart request can have multiple parts (sic). Thus you can send files in the HTTP request along with the rest of the request.

Multipart can also be found in emails with attatchments.

streetpc
A: 

Request.form is not working when enctype="multipart/form-data" is used. Am I doing something worng in the code?

spraocs