Open solarjoe opened 3 years ago
When I upload a file that already exists on the server the file is updated but the function upload_file() states
upload_file()
is ok? False <OCSResponse: Status: Failed>
The logging for urllib3 shows that the call was
urllib3.connectionpool.DEBUG: https://server:443 "PUT /nextcloud/remote.php/dav/files/userc/folder/somefile.txt HTTP/1.1" 204 0
This issue states a similar behaviour and refers to this document:
8.8.5 Status Codes 204 (No Content) - The source resource was successfully copied to a pre-existing destination resource.
8.8.5 Status Codes
204 (No Content) - The source resource was successfully copied to a pre-existing destination resource.
WEBDAV seems to have a different interpretation for 204 than default HTTP.
I just saw that the section actually refers to COPY, but there are no return codes listed for PUT.
COPY
PUT
For now I just monkeypatched it:
"PUT": [WebDAVStatusCodes.CREATED_CODE, WebDAVStatusCodes.NO_CONTENT_CODE]
When I upload a file that already exists on the server the file is updated but the function
upload_file()
statesThe logging for urllib3 shows that the call was
urllib3.connectionpool.DEBUG: https://server:443 "PUT /nextcloud/remote.php/dav/files/userc/folder/somefile.txt HTTP/1.1" 204 0
This issue states a similar behaviour and refers to this document:
WEBDAV seems to have a different interpretation for 204 than default HTTP.