What exactly does putting enctype=“multipart/form-data” in the form tag do? I know that you must have it to make a file upload form work, but why?
4 REPLIES
Jeff
It tells your browser to encode the POST data as multipart/form-data, which is code for ‘there’s a couple parts, and one of them may be something besides a simple text field, so encode it accordingly’.
Without that, you’d get it sent as a URL-encoded list of variable/value pairs (&var=value), which makes transferring a file kinda tough…
- 30 January 2007 09:15 PM
-
- Log in or join for free to make a comment.
Topic Categories


