Skip to main content

Module uploads

Module uploads 

Source
Expand description

Safe temporary multipart uploads and explicit storage.

Applications define typed forms with axum_typed_multipart::TryFromMultipart. Use #[try_from_multipart(strict)] to reject unknown and duplicate fields, #[form_data(limit = "...")] on every file and text field, and request_body_limit on the route. File fields should use FieldData<NamedTempFile> so request bodies are streamed to temporary files. Authorization and application validation should run before store_upload.

Structs§

StoredUpload
Metadata returned after an accepted temporary upload is stored.
TemporaryUploadFile
Re-export of the streaming temporary-file type used in typed multipart forms. A named temporary file.

Functions§

request_body_limit
Applies an Axum total request-body limit while multipart fields are read.
store_upload
Stores a validated temporary upload under an opaque generated name.