Skip to content

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

@solarjoe

Description

@solarjoe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions