What is multipart/form-data?

multipart/form-data is a media type commonly used for HTTP form bodies. It packages form fields and file content into parts separated by a boundary declared in Content-Type. The format defines the body representation; resumability requires a separate transfer contract.

How multipart/form-data works

Each part has headers describing its field name and, for a file, possibly a filename and media type. A boundary separates the parts, and the enclosing Content-Type identifies that same boundary. Browser FormData serialization creates the body and header together. Setting a bare Content-Type: multipart/form-data manually can omit the generated boundary and prevent the receiver from parsing the request.

Key facts

  1. A single multipart form can include several files. That does not mean those files or their internal byte ranges can be resumed independently.
  2. The filename and part MIME type are supplied by the sender. Validate the file contents and normalize storage names on the receiving side.
  3. Form encoding does not determine buffering behavior. A server can stream a multipart body or buffer it, depending on its implementation.

When multipart/form-data matters

Use FormData when an endpoint expects a multipart form. Let the browser set Content-Type and its matching boundary, and use the field names defined by the receiving API.

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free