Skip to content

Commit

Permalink
fix(files): fix file downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
hstievat authored and alanzhu0 committed Jan 24, 2025
1 parent 888a599 commit 3df6cba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions intranet/apps/files/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3df6cba

Please sign in to comment.