Glossary

multipart/form-data explained.

multipart/form-data is the form encoding a browser uses when a submission includes files, splitting each field and each file's bytes into separate labeled parts of the request body.

Definition

How multipart/form-data works

The default form encoding, application/x-www-form-urlencoded, flattens every field into one text string of name=value pairs joined by ampersands. That falls apart the moment you need to send a file, because raw file bytes can't be safely squeezed into that text format.

multipart/form-data solves it by cutting the request body into parts, one per field. A unique boundary string separates the parts, and each part carries its own small header saying which field it belongs to and (for a file) its filename and content type, followed by the raw content. The server reads the boundary, walks the parts in order, and reconstructs both the plain text fields and the uploaded files exactly as sent. You opt into it by setting a form's enctype to multipart/form-data, and the browser fills in the matching Content-Type header with the boundary it chose.

For a form backend, this is the encoding that lets a submission carry an attachment (a CV, a screenshot, a receipt) alongside the ordinary text fields, so FormWire can parse the parts, store the file, and deliver both together.

Related questions

Want to see it working?

Read the docs
Ready in a minute

Accept files from your forms.

Free tier forever. No credit card required.