Skip to content
masterclass Buddy

FastAPI · Function

File

FastAPI uses File and UploadFile to receive files in multipart form data. Use bytes for small files or UploadFile for metadata, async methods, and better handling of large files.

Last updated

Syntax

File(default=Undefined, *, media_type="multipart/form-data", alias=..., description=..., ...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • UploadFile
  • Form
  • Request Forms and Files
  • python-multipart

Source: Request Files - FastAPI. Checked 2026-11-03.