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

How to delete a file? #39

Open
HLFH opened this issue Nov 29, 2024 · 0 comments
Open

How to delete a file? #39

HLFH opened this issue Nov 29, 2024 · 0 comments

Comments

@HLFH
Copy link

HLFH commented Nov 29, 2024

It seems we can only delete a directory?
If we upload a file at the same location, it does not upload it if the file is present, how to overwrite?

EDIT:
It should be documented in the README that you can delete files as well.

        encoded_location = URI::DEFAULT_PARSER.escape(location)
        @nextcloud_service.webdav.directory.destroy(encoded_location)

And that you need to encode the location for uploads as well in order for the upload to work.
And that you don't use the encoded location for the share_url method.

        encoded_location = URI::DEFAULT_PARSER.escape(location)
        @nextcloud_service.webdav.directory.upload(encoded_location, brand_file)
        share_url = @nextcloud_service.ocs_fs.create(location, 3, nil, nil).share_url
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