Skip to content

Commit

Permalink
fix: Chunked Upload V2 not working on Nextcloud 30 and later (#324)
Browse files Browse the repository at this point in the history
Previously the chunk number started with 0, which leads to errors.
Simple fix: starting chunk number with 1

Fixes: #319

Signed-off-by: DrZoidberg09 <[email protected]>
Co-authored-by: Alexander Piskun <[email protected]>
  • Loading branch information
DrZoidberg09 and bigcat88 authored Jan 12, 2025
1 parent 2cbf584 commit 77586a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nc_py_api/files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ def __upload_stream(self, path: str, fp, chunk_size: int) -> FsNode:
response = self._session.adapter_dav.request("MKCOL", _dav_path)
check_error(response)
try:
start_bytes = end_bytes = chunk_number = 0
start_bytes = end_bytes = 0
chunk_number = 1
while True:
piece = fp.read(chunk_size)
if not piece:
Expand Down

0 comments on commit 77586a5

Please sign in to comment.