Home > Article > Web Front-end > form What is the use of using enctype field when uploading files_HTML/Xhtml_Web page production
The enctype attribute of the FORM element specifies the encoding type used when submitting form data to the server. The default value is "application/x-www-form-urlencoded".
This encoding method will urlencode the content before sending the form. (Spaces are converted to " ", and special characters are converted to ASCII HEX values).
For example, if we fill in bb in the form field
firstname,
the result we get before sending is: bb,,
However, This encoding is inefficient when sending large amounts of text, text containing non-ASCII characters, or binary data to the server.
When uploading files, the encoding type used should be "multipart/form-data", which can send text data and also supports binary data upload.
The ENCTYPE attribute value of the