Forms & Controls
enctype="multipart/form-data"
Encodes fields as separate MIME parts with a generated boundary. Use for POST forms containing file controls; let the browser generate the boundary rather than setting it manually. POST form encoding; formenctype may override it. Missing or invalid values default to application/x-www-form-urlencoded. The example requires a server endpoint.
Formal Syntax & Structure
html syntaxhtml
enctype="multipart/form-data"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| enctype | keyword | Encodes fields as separate MIME parts with a generated boundary. Use for POST forms containing file controls; let the browser generate the boundary rather than setting it manually. |
Working Example
Example Snippethtml
<form method="post" action="/upload" enctype="multipart/form-data"> <label> File <input type="file" name="attachment"> </label> <button>Upload</button></form>