Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload_file() returns "Status: Failed" when a file is overwritten #61

Open
solarjoe opened this issue Mar 19, 2021 · 2 comments
Open

upload_file() returns "Status: Failed" when a file is overwritten #61

solarjoe opened this issue Mar 19, 2021 · 2 comments

Comments

@solarjoe
Copy link

When I upload a file that already exists on the server the file is updated
but the function upload_file() states

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.

WEBDAV seems to have a different interpretation for 204 than default HTTP.

@solarjoe
Copy link
Author

I just saw that the section actually refers to COPY, but there are no return codes listed for PUT.

@solarjoe
Copy link
Author

For now I just monkeypatched it:

"PUT": [WebDAVStatusCodes.CREATED_CODE, WebDAVStatusCodes.NO_CONTENT_CODE]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant