From 43becb051ecd13b9cc4ffb232063e18eddcc00e1 Mon Sep 17 00:00:00 2001 From: DrZoidberg09 <96449693+DrZoidberg09@users.noreply.github.com> Date: Sun, 5 Jan 2025 12:00:41 +0100 Subject: [PATCH] fix: Chunked Upload V2 not working on Nextcloud 30 and later Previously the chunk number started with 0, which leads to errors. Simple fix: starting chunk number with 1 Fixes: #319 Signed-off-by: DrZoidberg09 <96449693+DrZoidberg09@users.noreply.github.com> --- nc_py_api/files/files.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nc_py_api/files/files.py b/nc_py_api/files/files.py index 8b356c2a..515dcee3 100644 --- a/nc_py_api/files/files.py +++ b/nc_py_api/files/files.py @@ -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: