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

Uploading to a directory fails when a conflicting file is present #121

Closed
aaronwolen opened this issue Feb 14, 2020 · 1 comment
Closed
Labels

Comments

@aaronwolen
Copy link
Member

library(osfr)
#> Automatically registered OSF personal access token
#> <Logging enabled: ~/Library/Logs/osfr.log>
#> <Testing server enabled: test.osf.io>
p1 <- osf_create_project("dir-upload-bug")
d1 <- osf_mkdir(p1, "uploads")

osf_upload(d1, system.file("CITATION"))
#> # A tibble: 1 x 3
#>   name     id                       meta            
#>   <chr>    <chr>                    <list>          
#> 1 CITATION 5e46a657d1833a0009333517 <named list [3]>
osf_upload(d1, system.file("CITATION"), conflicts = "skip")
#> Error: Cannot complete action: file or folder "CITATION" already exists in this location
#>        HTTP status code 409.

Created on 2020-02-14 by the reprex package (v0.3.0)

@aaronwolen aaronwolen added the bug label Feb 14, 2020
@mnoetel
Copy link

mnoetel commented May 21, 2020

Interesting that this only happens to me when the target is a folder:

public_dat <- osf_retrieve_node("u5x3r") %>% osf_ls_files(pattern = "Data")
public_dat %>% osf_upload(file_name_descriptives, conflicts = "overwrite", verbose = T)
Searching for conflicting files on OSF
Uploading 1 new file(s) to OSF
Error: Cannot complete action: file or folder "latest_descriptives_of_each_variable.csv" already exists in this location
HTTP status code 409.

public_dat <- osf_retrieve_node("u5x3r")
public_dat %>% osf_upload(file_name_descriptives, conflicts = "overwrite", verbose = T)
Searching for conflicting files on OSF
Uploading 1 new file(s) to OSF
Uploaded new file 'latest_descriptives_of_each_variable.csv' to OSF

public_dat %>% osf_upload(file_name_descriptives, conflicts = "overwrite", verbose = T)
Searching for conflicting files on OSF
Updating 1 existing file(s) on OSF
Uploaded new version of 'latest_descriptives_of_each_variable.csv' to OSF

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

No branches or pull requests

2 participants