multipart/form-data
GlossaryThe HTML form encoding type that allows file attachments alongside text fields.
Definition
multipart/form-data is the `enctype` for HTML forms that need to upload files. It encodes the form body as multiple MIME parts separated by a boundary string — one part per field or file. When you add `enctype="multipart/form-data"` to a form or send a `FormData` object from JavaScript, the browser encodes the payload this way. FormLoom parses multipart payloads automatically when you use `<input type="file">` or include binary data.
Why it matters for form backends
If you want file uploads in your form, you must use multipart/form-data encoding. JSON won't carry binary file data.
Example
html
<form action="https://api.formloom.ai/submit/YOUR_KEY"
method="POST"
enctype="multipart/form-data">
<input type="file" name="attachment" />
<button type="submit">Upload</button>
</form>FAQ
Use `new FormData()` in JavaScript — the browser sets the correct `multipart/form-data` encoding automatically. Don't JSON.stringify() when sending files.
Related terms
Ready to put this into practice?
Add a form to your site in minutes — free access key, copy-paste snippet.