Skip to main content

Module upload

Module upload 

Source
Expand description

multipart/form-data parsing — UploadedFile and the file bag.

Deliberately a buffered parser: it takes the complete body and splits it on the boundary, rather than streaming parts as they arrive. That matches the rest of the request model (see crate::body) and keeps $request->file('avatar') a synchronous call. The protection against a malicious 10 GB upload is therefore the server’s body-size limit, applied before this ever runs — not backpressure inside it.

Structs§

Multipart
The outcome of parsing a multipart/form-data body: ordinary fields lifted into a JSON tree, plus the files.
UploadedFile
A file received in a multipart/form-data request.

Functions§

boundary_of
Pull the boundary= parameter out of a Content-Type header.
parse
Parse a multipart/form-data body given its boundary.