HTML Attributes
HTML formenctype attribute
Overrides the associated form's encoding when this submit control initiates submission. Use multipart/form-data for file upload requests. Applicable elements include: <button>, <input>. Check each element’s value rules.
Formal Syntax & Structure
html syntaxhtml
formenctype="multipart/form-data"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| formenctype | form encoding keyword | Overrides the associated form's encoding when this submit control initiates submission. Use multipart/form-data for file upload requests. |
Working Example
Example Snippethtml
<form method="post"> <label> File <input type="file" name="file"> </label> <button formenctype="multipart/form-data">Upload</button></form>Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
9
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
4
Yes
WebKit
Safari
5
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for formenctype on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard