Skip to content

Commit 2907535

Browse files
committed
fix(files): fix file downloads
1 parent 5ff2d9e commit 2907535

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intranet/apps/files/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def can_access_path(fsdir):
225225
content_len = tmpfile.tell()
226226
tmpfile.seek(0)
227227
chunk_size = 8192
228-
response = StreamingHttpResponse(FileWrapper(tmpfile, chunk_size), content_type="application/octet-stream")
228+
response = StreamingHttpResponse([*FileWrapper(tmpfile, chunk_size)], content_type="application/octet-stream")
229229
response["Content-Length"] = content_len
230230
response["Content-Disposition"] = f"attachment; filename={filebase_escaped}"
231231
return response
@@ -294,7 +294,7 @@ def can_access_path(fsdir):
294294
content_len = tmpfile.tell()
295295
tmpfile.seek(0)
296296
chunk_size = 8192
297-
response = StreamingHttpResponse(FileWrapper(tmpfile, chunk_size), content_type="application/octet-stream")
297+
response = StreamingHttpResponse([*FileWrapper(tmpfile, chunk_size)], content_type="application/octet-stream")
298298
response["Content-Length"] = content_len
299299
if not dirbase_escaped:
300300
dirbase_escaped = "files"

0 commit comments

Comments
 (0)