Skip to content

Commit

Permalink
Log chunk stats for uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 11, 2023
1 parent 979d25a commit 698524b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/web/src/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,13 @@ def upload_file():

try:
with open(tmp_save_path, "ab") as save:
log.info(request.form)
log.info(request.files)
save.seek(int(request.form["dzchunkbyteoffset"]))
save.write(file_object.stream.read())
chunk = file_object.stream.read()
# Remove CRLF characters from the end of the chunk
# chunk = chunk.rstrip(b"\r\n")
save.write(chunk)
except OSError:
log.exception("Could not write to file")
return make_response(_("Unable to write the file to disk!"), 500)
Expand Down

0 comments on commit 698524b

Please sign in to comment.