axum-impl-file-upload
OfficialStream safe uploads without 413s or panics.
System Documentation
What problem does it solve?
This Skill helps you implement reliable Axum file-upload endpoints that accept real multipart/form-data uploads while enforcing safe body limits, correct extractor ordering, streaming to avoid memory blowups, and proper handling of MultipartError instead of production panics.
Core Features & Use Cases
- Correct multipart handler structure: Ensures
Multipartis the only body-consuming extractor and is the last handler argument, preventing compile-time failures and runtime misbehavior. - Safe iteration and field reading: Drives
next_field()untilOk(None)and reads field metadata (name/filename/content-type) before consuming the body viabytes(),text(), orchunk(). - Body limit and DoS resistance: Uses
DefaultBodyLimit(and when neededRequestBodyLimitLayer) to avoid default 2MB rejections, prevent unbounded uploads, and return appropriate 413-class behavior. - Secure file handling: Avoids path traversal by never trusting
file_name()for destination paths, and prefers streamingchunk()intotokio::fs::Fileto keep peak memory bounded.
Quick Start
Use the axum-impl-file-upload skill to design a production-ready Rust handler for /upload that streams an uploaded file to disk safely, sets a clear request body ceiling, and returns a 400 response on malformed multipart bodies instead of panicking.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: axum-impl-file-upload Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-impl-file-upload Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.