I'm using FastAPI and I want to receive files into memory and not onto disk and then re-read them from disk.
My current endpoint looks like this:
async def upload_file(files: List[UploadFile] = File(...):
pass
Problems I've encountered while searching for a solution
- I need
UploadFileand notbytesas suggested here, since I need to know thecontent_typeproperty of the files. - I've tried to find a way to access the
SpooledFileattrributemax-sizeto allow memory storage up to this size like written in this Python doc, but to no effect.
Thanks in advance! :)