What is formenctype Attribute in HTML Form ?
The HTML formenctype attribute is used to specify the type of encoding to be used when submitting the form. It defines how the form data should be encoded when it is sent to the server.
Basically, there are ways to be used to encode the form data.
- application/x-www-form-urlencoded: It is the default value. It encodes all the characters before being sent to the server. It converts spaces into + symbols and special characters into its hex value.
- multipart/form-data: It is used to encode the file upload controls. This value does not encode any character. we can not upload images and files without using this encoding type.
- text/plain: This value converts spaces into + symbols but special characters are not converted.