[gen] pod field: bugfix: download a generated or frozen pod result.
This commit is contained in:
parent
1455a74056
commit
d9d93a650b
|
@ -212,11 +212,12 @@ class FileInfo:
|
|||
self.modified = DateTime()
|
||||
self.size = os.stat(fsName).st_size
|
||||
|
||||
def writeResponse(self, response, dbFolder=''):
|
||||
def writeResponse(self, response, dbFolder='', disposition='inline'):
|
||||
'''Writes this file in the HTTP p_response object.'''
|
||||
# As a preamble, initialise response headers.
|
||||
header = response.setHeader
|
||||
header('Content-Disposition', 'inline;filename="%s"' % self.uploadName)
|
||||
header('Content-Disposition',
|
||||
'%s;filename="%s"' % (disposition, self.uploadName))
|
||||
header('Content-Type', self.mimeType)
|
||||
header('Content-Length', self.size)
|
||||
header('Accept-Ranges', 'bytes')
|
||||
|
|
|
@ -731,7 +731,10 @@ class Pod(Field):
|
|||
# attachment?
|
||||
mailing = rq.get('mailing')
|
||||
if not mailing:
|
||||
res.writeResponse(rq.RESPONSE)
|
||||
# With disposition=inline, Google Chrome and IE may launch a PDF
|
||||
# viewer that triggers one or many additional crashing HTTP GET
|
||||
# requests.
|
||||
res.writeResponse(rq.RESPONSE, disposition='attachment')
|
||||
return
|
||||
else:
|
||||
# Send the email(s).
|
||||
|
|
Loading…
Reference in a new issue