Fix filename in batch file download link (again).
This hopefully prevents encoding errors which were bound to happen...
This commit is contained in:
parent
26e5be9897
commit
6c7f1afcf4
|
@ -685,7 +685,8 @@ class FileBatchCrud(BatchCrud):
|
||||||
path = batch.filepath(config)
|
path = batch.filepath(config)
|
||||||
response = FileResponse(path, request=self.request)
|
response = FileResponse(path, request=self.request)
|
||||||
response.headers[b'Content-Length'] = str(batch.filesize(config))
|
response.headers[b'Content-Length'] = str(batch.filesize(config))
|
||||||
response.headers[b'Content-Disposition'] = b'attachment; filename="{0}"'.format(batch.filename)
|
response.headers[b'Content-Disposition'] = b'attachment; filename="{0}"'.format(
|
||||||
|
batch.filename.encode('ascii', 'replace'))
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue