litestar-file-uploads
Installation
SKILL.md
File Uploads
Execution Workflow
- Decide whether the endpoint truly needs multipart file transport.
- Choose the input shape: single
UploadFile, typed multipart model,dict[str, UploadFile], orlist[UploadFile]. - Declare multipart explicitly with
Body(media_type=RequestEncodingType.MULTI_PART). - Validate filename, content type, size expectations, and field layout before expensive processing.
- Stream or hand off large files to storage/services without unbounded memory use.
- Keep upload parsing and validation at the transport edge; move persistence and scanning into services.