Log chunk stats for uploading

This commit is contained in:
Daniel Markstedt 2023-11-11 11:16:22 +09:00
parent 7a197d6754
commit bff43be3c2
1 changed files with 6 additions and 1 deletions

View File

@ -1072,8 +1072,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)