File upload
A urlencoded body can only carry a file's name. A :form that contains a file field now declares enctype="multipart/form-data" and the runtime posts the FormData itself, letting the browser write the multipart boundary. Nothing else about the form changes.
Pick a file and send it
Uploaded , bytes, type { reply.type }.
Caption:
The server also said which field was wrong:
Submit with no file to see the failure path: the endpoint answers 422 with a JSON body, and the page renders the server's own sentence rather than "HTTP 422".
The rules
- A file field makes the whole form multipart. The compiler writes the
enctypefor the browser's native submit, and the runtime sends theFormDatawith no content-type of its own so the boundary is correct. - Bound controls inside the form (a
:bind, a bound:select) carry noname, soFormDatanever sees them. On the multipart path they are appended by their state key rather than silently dropped. - A file field with
method="get"is a compile error. A GET request has no body, so only the file's name would ever travel, the kind of failure that looks like it worked.