Skip to main content

Module multipart

Module multipart 

Source
Expand description

Shared multipart-body parsing helpers.

Provides parse_multipart — a generic drain over an axum::extract::Multipart stream that classifies each part as either an in-memory form field (≤ 4 KiB) or a spooled file written to a per-request temp directory.

Per-router validation (filename traversal checks, URL-body detection, extension checks, …) belongs in each router’s own parse adapter, not here.

Structs§

MultipartOpts
Options that control multipart parsing.
ParsedForm
Result of a parse_multipart call.
SpooledFile
A single spooled-to-disk file part.
UploadGuard
RAII wrapper that removes the per-request spool directory on Drop.

Functions§

check_filename_traversal
Check a filename for path traversal sequences.
parse_multipart
Drain an axum Multipart stream into a ParsedForm.
sanitize_path_component
Replace any filesystem-unsafe characters with _ and truncate to 200 chars.