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.
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.
Three things a file upload needs.
A file input
An input of type file, optionally with multiple for several files and accept to hint at the types you want.
Multipart encoding
The form's enctype must be multipart/form-data, so the browser packages each file as its own binary part.
A POST request
Files ride in the request body, which only a POST can carry. A GET form has no body and cannot attach a file.
Related questions
Almost always because the form is missing enctype="multipart/form-data" or isn't using method POST. Without the right enctype the browser sends only the file's name, not its contents, so the file never actually reaches the server.
See why enctype is the fix →Yes. Add the multiple attribute to the file input and the visitor can select several files in one control. Each is sent as its own part in the multipart body, so they all arrive with the submission.
No. A plain HTML form with a file input, method POST and multipart encoding uploads files with zero script. JavaScript is only useful if you want a drag-and-drop area or a progress bar, which submit the same multipart body via fetch.
The endpoint accepts multipart submissions, stores each attached file with the submission record, and includes the files when it delivers the entry to you. You add a file input and set the enctype, and the backend takes care of parsing and storage.
Want to see it working?
Read the docsAccept file uploads without running a server.
Free tier forever. No credit card required.