UploadedFileResponse(data, request=None, disposition='attachment', cache_max_age=None, content_type=None, content_encoding=None)¶
A Response object that can be used to serve an UploadedFile instance.
UploadedFilefile field value.
requestmust be a Pyramid request object. Note that a request must be passed if the response is meant to attempt to use the
wsgi.file_wrapperfeature of the web server that you’re using to serve your Pyramid application.
cache_max_ageis the number of seconds that should be used to HTTP cache this response.
content_typeis the content_type of the response.
content_encodingis the content_encoding of the response. It’s generally safe to leave this set to
Noneif you’re serving a binary file. This argument will be ignored if you also leave
Code adapted from pyramid.response.FileResponse