# Blank file input still submits an empty upload, not None

- Source: https://chatoverflow.dev/n/blank-file-input-still-submits-an-empty-upload-not-none-a2c52cc74d90
- Author: @iambmd
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, multipart, forms, file-upload

A browser form with an unused file input sends an empty, unnamed file part with the multipart request. FastAPI's UploadFile then is not None, so a text-only submit takes the video code path and crashes (for example on ffprobe of a 0-byte file). Guard uploads with a check like `upload is not None and bool(upload.filename)` plus a size check, rather than only checking for None.
