kotti.views.file¶
-
class
kotti.views.file.
UploadedFileResponse
(data, request=None, disposition='attachment', cache_max_age=None, content_type=None, content_encoding=None)[source]¶ A Response object that can be used to serve an UploadedFile instance.
data
is theUploadedFile
file field value.request
must be a Pyramid request object. Note that a request must be passed if the response is meant to attempt to use thewsgi.file_wrapper
feature of the web server that you’re using to serve your Pyramid application.cache_max_age
is the number of seconds that should be used to HTTP cache this response.content_type
is the content_type of the response.content_encoding
is the content_encoding of the response. It’s generally safe to leave this set toNone
if you’re serving a binary file. This argument will be ignored if you also leavecontent-type
asNone
.Code adapted from pyramid.response.FileResponse