mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00
[FIX] attachment_zipped_download: fix stream download
Before the fix, 0 bytes would be transferred.
This commit is contained in:
parent
1a4bdedbc2
commit
c2b4ab0f2d
@ -13,9 +13,11 @@ class AttachmentZippedDownloadController(http.Controller):
|
|||||||
return
|
return
|
||||||
list_ids = map(int, ids.split(","))
|
list_ids = map(int, ids.split(","))
|
||||||
out_file = request.env["ir.attachment"].browse(list_ids)._create_temp_zip()
|
out_file = request.env["ir.attachment"].browse(list_ids)._create_temp_zip()
|
||||||
return http.send_file(
|
stream = http.Stream(
|
||||||
filepath_or_fp=out_file,
|
type="data",
|
||||||
|
data=out_file.getvalue(),
|
||||||
mimetype="application/zip",
|
mimetype="application/zip",
|
||||||
as_attachment=True,
|
as_attachment=True,
|
||||||
filename=_("attachments.zip"),
|
download_name=_("attachments.zip"),
|
||||||
)
|
)
|
||||||
|
return stream.get_response()
|
||||||
|
Loading…
Reference in New Issue
Block a user