The enctype attribute of the FORM element specifies the encoding type used when submitting form data to the server. The default default is application/x-www-form-urlencoded.
This encoding method will urlencode the content before the form is sent. (Spaces are converted to +, special characters are converted to ASCII's HEX value).
For example, we are in the form field
Fill in bb,
The result before sending is: bb+%2C%2C
However, this encoding method is inefficient when sending large amounts of text, text containing non-ASCII characters, or binary data to the server.
When uploading a file, the encoding type used should be multipart/form-data, which can send text data and support binary data upload.
The ENCTYPE attribute value of the browser <form> form is multipart/form-data, which tells us that the data transmitted should be used by the multimedia transmission protocol. Since the multimedia transmits a large amount of data, it is stipulated that the uploaded file must be a post method and the type attribute of <input> must be a file.