# File Upload

say it: **“FYLE UP-lohd”** **/ˈfaɪl ˈʌpˌloʊd/**

Accepts uploaded files with \`UploadFile\`.

## What is **File Upload**?

Use `UploadFile` to accept uploaded files. It streams the file instead of loading it all into memory.

```python
@app.post('/avatar')
async def upload_avatar(file: UploadFile):
    data = await file.read()
    return {'name': file.filename, 'bytes': len(data)}
```

Level: Journeyman · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=3)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/file-upload
