Html form enctype

In HTML forms related to file uploads, the attribute enctype = "multipart / form-data" must be set. I know that. But why? What exactly has this changed? How is it different from application / x-www-form-urlencoded?

+4
source share
3 answers

Here's the W3C doc on both counts. It is rather dry, but it may help some.

+2
source

By default, appliaction / x-www-form-urlencoded cannot send a) large quantities or binary data, or b) text containing non-ASCII characters. That is why you need to set it to multipart / form-data to upload files.

+2
source

A multipart request can contain several parts (sic). This way you can send files in the HTTP request along with the rest of the request.

A multi-page file can also be found in linked emails.

+2
source

Source: https://habr.com/ru/post/1286000/


All Articles