From 3df6cbacd1f67f17fc687d6e6b733c055800df40 Mon Sep 17 00:00:00 2001 From: Henry Stievater Date: Sat, 28 Dec 2024 14:04:12 -0500 Subject: [PATCH] fix(files): fix file downloads --- intranet/apps/files/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intranet/apps/files/views.py b/intranet/apps/files/views.py index 183de9a4079..0c77ed90b2b 100644 --- a/intranet/apps/files/views.py +++ b/intranet/apps/files/views.py @@ -225,7 +225,7 @@ def can_access_path(fsdir): content_len = tmpfile.tell() tmpfile.seek(0) chunk_size = 8192 - response = StreamingHttpResponse(FileWrapper(tmpfile, chunk_size), content_type="application/octet-stream") + response = StreamingHttpResponse([*FileWrapper(tmpfile, chunk_size)], content_type="application/octet-stream") response["Content-Length"] = content_len response["Content-Disposition"] = f"attachment; filename={filebase_escaped}" return response @@ -294,7 +294,7 @@ def can_access_path(fsdir): content_len = tmpfile.tell() tmpfile.seek(0) chunk_size = 8192 - response = StreamingHttpResponse(FileWrapper(tmpfile, chunk_size), content_type="application/octet-stream") + response = StreamingHttpResponse([*FileWrapper(tmpfile, chunk_size)], content_type="application/octet-stream") response["Content-Length"] = content_len if not dirbase_escaped: dirbase_escaped = "files"