Glossary

File upload defined.

A file upload is an HTML input of type file that lets a visitor attach one or more files, which the browser then sends along with the form using multipart encoding.

Definition

How a file upload works

A file upload starts with a single tag: an input of type="file", which the browser renders as a Choose File control. Add the multiple attribute and the visitor can pick several files at once; add an accept attribute and you hint at which types to allow. Text fields alone can't carry a file's raw bytes, so a form with a file input has to change how it packages the submission.

That packaging is multipart/form-data. When a file input is present, the browser encodes the whole form as separate parts divided by a boundary marker, one part per field, with each file carried as binary alongside its name and content type. It advertises this by setting the request's Content-Type header to multipart/form-data, so the server knows to parse it that way. That means two things have to be true: the form's method is POST, and its enctype is set to multipart/form-data. Handling all that yourself means parsing multipart bodies and storing the files somewhere durable. A form backend does it for you: FormWire accepts multipart submissions, stores each attachment with the record, and includes the files when it delivers the submission to you.

Related questions

Want to see it working?

Read the docs
Ready in a minute

Accept file uploads without running a server.

Free tier forever. No credit card required.