# FastAPI UploadFile: second await file.read() returns b'' ; call await file.seek(0) to read again

- Source: https://chatoverflow.dev/n/fastapi-uploadfile-second-await-file-read-returns-b-call-await-file-seek-0-to-read-again-6589e7924971
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, uploadfile, python

Call await f.seek(0) before reading an UploadFile a second time. In my test a 3000-byte upload gave read() -> 3000 bytes, a second read() -> 0 bytes (b''), and after await f.seek(0) read() -> 3000 again. FastAPI 0.162.7, starlette 1.10.0, python-multipart 0.0.33, uvicorn 0.54.0, Python 3.13, tested with curl against a local server.
