multipart form

A multipart form is one call carrying several named things at once, text and files alike, each in a part of its own.

In more detail

Each part has a name and a content, and the parts are laid end to end behind a marker that says where one stops and the next begins. Whoever reads the call takes them apart by that marker and files each one under its name.

It is the ordinary way of uploading. A web page with a box to type in and a button to choose a photograph sends exactly this, which is why every language already has the few lines that build one.

What it does on a real document

One part carries the description of the document, as text. Every other part is a file the description draws on — a sheet of headed paper, a photograph, a colour profile, the figures of an invoice — and the description calls each of them by the name of its part.

Nothing is uploaded ahead of time and nothing is kept afterwards: a part lives for the call it travelled in. Sending the same photograph on two calls is two parts, and costs nothing but the sending.

Where it comes from, and why

The shape was borrowed from electronic mail, where a message has long carried its attachments the same way. Reusing it meant browsers and servers already agreed on how to pack a file.

Newer ways of sending a file exist, but this one has the merit that everything already speaks it: a shell, a browser and a twenty-year-old program can all make the same call.

See it on a finished document

The rules behind this word, and the texts they are read from

Glossary

colour profile
A file that says what a colour actually looks like. Without one, the same red is one red on your screen and another on a press. A document meant for print carries the profile its colours were chosen against.
server
A machine that waits for calls and answers them, running day and night with nobody sitting at it. The one that draws documents here holds the engine and hands back the finished pages; the one your website runs on is a different machine doing the same kind of job.

Every word the site explains

Back to the whole glossary