Forms & Controls

enctype="multipart/form-data"

Build a form with the HTML form generator

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

NameTypeDescription
enctypekeywordEncodes 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>
HTML Reference