1

I am trying to download a data package from KNB and keep getting an "cannot open URL" and "InternetOpenUrl failed: 'A certificate is required to complete client authentication'". I have checked my github credentials and everything seems to be in order, but I just updated git and setup a PAT. Code below, but note that you will have to set your own directory.

This worked literally two weeks ago. Not sure what changed.

download.file("https://knb.ecoinformatics.org/knb/d1/mn/v2/packages/application%2Fbagit-097/resource_map_urn%3Auuid%3A14644b19-6e53-4063-aad9-fc823a45ac50", destfile = #your dir#, method = "wininet")
wraymond
  • 295
  • 1
  • 6
  • 17

1 Answers1

0

The suggested adding 'mode = "wb"' to download.file() works. I have been able to download, unzip and access the various data types in the downloaded folder.

Thank you!

download.file("https://knb.ecoinformatics.org/knb/d1/mn/v2/packages/application%2Fbagit-097/resource_map_urn%3Auuid%3A14644b19-6e53-4063-aad9-fc823a45ac50", destfile = #your dir#, method = "libcurl", mode = "wb")

unzip(zipfile = "./data.zip", exdir = "./data")
wraymond
  • 295
  • 1
  • 6
  • 17