axum-impl-file-upload
Installation
SKILL.md
axum-impl-file-upload
Overview
Axum receives file uploads through axum::extract::Multipart, the extractor
for multipart/form-data request bodies. It is feature-gated behind the
multipart Cargo feature and does not exist without it.
Two facts govern every upload handler:
Multipartconsumes the request body, so it is aFromRequestextractor and MUST be the last argument of the handler. Only one body-consuming extractor is allowed per handler.- Axum caps request bodies at 2 MB by default through
DefaultBodyLimit. An upload endpoint therefore works for small test files and then rejects real files with a413-class response until that ceiling is raised.