FastAPI – How to specify filename when downloading bytes content using Response class?
I need to download files stored in MongoDB (and not in file system) using FastAPI.
I use FastAPI Response
for this, because FileResponse
can only be used if files are in the file system. Downloading works, but I cannot find a way to specify the filename
when downloading it.