I'm migrating user-uploaded files from a local filesystem to MinIO (an
S3-compatible file server). I can't use FileResponse because I get
back a filehandle or a bytes, and I'd have to write it to a temporary
file to use FileResponse.I'm also exploring presigned URLs to have the
browser fetch the file, but right now I want to serve it server-side.
What Pyramid response args should I use, and how should I stream the
content? I looked at the source of FileResponse, and it creates an
'app_iter' object using 'environ["wsgi.file_wrapper"]'. Do I have to
do all that? Or can I just do 'body_file=result["body"]', which is the
filehandle and has a 'read' method. What is 'wsgi.file_wrapper'
anyway?
--
Mike Orr <
slugg...@gmail.com>