You have a form tag that contains the attribute
enctype='multipart/form-data'. What does it mean in an
HTML form and when should we use it?
The enctype attribute specifies how the form-data should be encoded when submitting it to the server. There are three methods of encoding. These are-
- application/x-www-form-urlencoded (default value)
Meaning: “multipart/form-data” explains that no characters are encoded (Encoding is that spaces are converted to “+” symbols, and special characters are converted to ASCII HEX values).
- Use this, if you want to control file upload in your form tag of your page.
- When your form includes <input type= “file”> element.
<form action="demo.asp" method="post" enctype="multipart/form-data"> First name: <input type="file" name="fname"> </form>