LibraryActive

FastAPI UploadFile

Class for receiving uploaded files in FastAPI path operation functions.

Open source page

Product features

Product features

content_type attribute

The content type of the request, from the headers.

Create it ¶

Example ¶

FastAPI mini documentary ¶

FastAPI ¶

file attribute

The standard Python file object (non-async).

filename attribute

The original file name.

Gold Sponsors ¶

headers attribute

The headers of the request.

Installation ¶

Keystone Sponsor ¶

Opinions ¶

read

Read some bytes from the file.

Requirements ¶

seek

Move to a position in the file.

Silver Sponsors ¶

size attribute

The size of the file in bytes.

Sponsors ¶

Typer , the FastAPI of CLIs ¶

write

Write bytes to the file.