HTML CSS examples for HTML Tag:form
The enctype attribute sets how the form-data should be encoded when submitting it to the server.
The enctype attribute can be used only if method="post".
Value | Description |
---|---|
application/x-www-form-urlencoded | Default. All characters are encoded before sent (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values) |
multipart/form-data | No characters are encoded. This value is for a file upload control |
text/plain | Spaces are converted to "+" symbols, but no special characters are encoded |
The following code shows how to Send form-data encoded as "multipart/form-data":
<!DOCTYPE html> <html> <body> <form action="/action_page_binary.asp" method="post" enctype="multipart/form-data"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit"> </form><!-- w w w. j ava 2 s.c o m--> </body> </html>