Skip to content
Discussion options

You must be logged in to vote

First, for the case of @petermorrownavican , I added a new feature to support UploadFile (from Starlette) in FastAPI, the new documentation is here: https://fastapi.tiangolo.com/tutorial/request-files/#file-parameters-with-uploadfile

That would probably be the best way to deal with large files.

It uses a standard "spooled" file (in memory up to some limit, then on disk).

And you can interact with it as a normal file in Python.

Stream request content

If you have some specific use case that requires you to read the bytes as a stream of content, chunk by chunk (that also means that you don't need to have to whole content/file before starting to read it), you can use the same code as in the e…

Replies: 15 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
9 participants
Converted from issue

This discussion was converted from issue #58 on February 28, 2023 14:56.