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

osf_download returns corrupted files #143

Open
SHogenboom opened this issue Aug 8, 2022 · 1 comment
Open

osf_download returns corrupted files #143

SHogenboom opened this issue Aug 8, 2022 · 1 comment

Comments

@SHogenboom
Copy link

I was trying to understand the osfr package and tried to apply the following example from the [osfr documentation](

https://docs.ropensci.org/osfr/articles/getting_started.html#a-few-details-about-files-on-osf):

osf_retrieve_file("vbdah") %>%
  osf_download(excel_file)

This code does not work because the variable excel_file is not specified. Therefore I tried the code:

osf_retrieve_file("vbdah") %>%
  osf_download()

This appears to download the file (Calculating_Effect_Sizes.xlsx) while throwing the error:

Error in `.wb_download()`:
! The requested file (vbdah) could not be found in node `ixgcd`

When trying to access the file it turns out that it is in fact corrupted. I've had the same issue when trying to download zip files from url and identifier. Really not sure if I'm misunderstanding the documentation or that downloading directly from GUID no longer works.

@SHogenboom
Copy link
Author

For my personal usecase the issue appeared to be in the type of id required by the osf_download() function.

The documentation specifies that the id as visible in the URL should suffice. Which is not the case, even for the example provided in the documentation. When manually moving through all the folders like so:

  project <-
    osfr::osf_retrieve_node(id = "ixgcd") |>
    osfr::osf_ls_files(
      n_max = Inf
    )

Ultimately, the id associated with the individual files is different from the id available via the URL:

id_url <- "vbdah"
id_project_file <- "5574619f8c5e4a1a5a7a03b4"

I presume this is the difference between the Waterbutler and the OSF id which was mentioned somewhere. When using this longer id the osf_download() function works again as expected.

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