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.
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.
What multipart encoding gives you.
Carries files
Raw bytes ride in their own part with a filename and content type, so uploads survive the trip intact instead of being mangled.
One part per field
Every input becomes a labeled section split by a boundary string, so text fields and files travel together in a single request.
Set by enctype
You choose it with the form's enctype attribute, and the browser adds the matching Content-Type header and boundary for you.
Related questions
Whenever the form uploads a file. An input of type file only sends its contents if the form's enctype is multipart/form-data. For a form of ordinary text fields, the default urlencoded encoding is smaller and perfectly fine.
The enctype attribute, defined →It is a random marker string the browser picks that cannot appear inside the data, used to separate one part from the next. The browser announces it in the Content-Type header so the server knows exactly where each part starts and ends when it parses the body.
Slightly. Each part carries its own small header and boundary, which adds overhead that urlencoded avoids. For a text-only form there is no benefit, so browsers only reach for multipart when a file is present or you set the enctype yourself.
It splits the body on the boundary, reads each part's header to learn the field name, filename and content type, then takes the bytes that follow as the value. A form backend does this parsing for you and hands over the stored file rather than a raw multipart stream.
Want to see it working?
Read the docsAccept files from your forms.
Free tier forever. No credit card required.