Attribute: Formenctype

The formenctype attribute specifies how the form-data should be encoded when submitting it to the server (only for forms with method="post"). The formenctype attribute overrides the enctype attribute of the <form> element. This attribute is used with type="submit" and type="image". This example will send form-data that is default encoded with the first submit button, and encoded as "multipart/form-data" with the second submit button:

HTML file: Displayed by browser:
<form action="http://www.w3schools.com/html/demo_post_enctype.asp" method="post">
First name: <input type="text" name="fname">
<br />
<br /><input type="submit" value="Submit">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" formenctype="multipart/form-data" value="Submit as Multipart/form-data">
</form>
First name:

    

This should work with all major browsers.

Back button Table of Contents Next button