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

Investigate uploadFile option overwrite capability #12

Closed
eblondel opened this issue Jan 22, 2021 · 3 comments
Closed

Investigate uploadFile option overwrite capability #12

eblondel opened this issue Jan 22, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eblondel
Copy link
Owner

To look at both owncloud and nextcloud impls.
This relates to OwnCloud user request eblondel/ownCloud4R#8

@eblondel eblondel self-assigned this Jan 22, 2021
@eblondel eblondel added the enhancement New feature or request label Jan 22, 2021
@eblondel
Copy link
Owner Author

A first attempt was to add a delete_if_existing parameter (default = FALSE).

The overwrite logic has to be further studied in key cloud solutions like OwnCloud and NextCloud. the latter (Next cloud) seems to indicate that overwrite is the default behaviour (pending question of how resources shared with public links are then treated, if link is conserved or not). In the former (ownCloud) , the overwrite is not possible by default, and we get an error when attempting to reupload some file. This may be due to the fact the Owncloud UI asks the user what to do when re-uploading a file, between overwriting or keeping a separate copy of the file.
In the case of OwnCloud, the delete_if_existing can be set to true, having similar result as the overwrite, to answer some basic use case, but with the limit that if the previous file was shared with a public link, this link will be probably lost, because the file is first deleted to be then reuploaded as new resource.

@eblondel eblondel added this to the 0.2 milestone Jan 27, 2021
@eblondel
Copy link
Owner Author

In nextcloud, this should work if we catch well http status code 204 (no content). Commit to follow cc @wheintz

eblondel added a commit that referenced this issue Mar 17, 2022
eblondel added a commit that referenced this issue Mar 17, 2022
@eblondel
Copy link
Owner Author

Guys, this seems solved according to the latest fix and test done. I've included the HTTP code 204 (no content) as acceptable for upload, and the test performs 2 successive uploads, both successful!

@eblondel eblondel added bug Something isn't working and removed enhancement New feature or request labels Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant