I have an R package that requires large (> 100 MB) files. (These are weight files for a large neural network.) My plan is to have a function download these files from google drive (although I'm open to other options if they exist). I can't download no matter what I try. I don't want to use the googledrive
package because I don't want users to need a google account. Note: This file has permissions set so that anyone with the link can access it. You can check here
I have tried following the directions here. This works for smaller files, but not for large files. I think this is because Google can't scan for viruses on files this big. Here is the code to follow that example. It downloads something that is 3250 bytes (not my file).
url <- "https://drive.google.com/uc?id=1_YtgWP2MAF7c4dW8naugP1RL3I-xB7G2"
temp <- tempfile(fileext = ".zip")
download.file(url, temp)
I have also tried using the curl and wget options, based on what I have found from using the command line tools explained here.
# I have tried both of these URLs (and some other options)
url <- "https://drive.google.com/uc?id=1_YtgWP2MAF7c4dW8naugP1RL3I-xB7G2"
url <- "https://drive.google.com/uc?export=download&id=1_YtgWP2MAF7c4dW8naugP1RL3I-xB7G2"
# I tried several options here too
download.file(url, temp, mode='wb',
#method='wget', extra=list('no-check-certificate', getOption("download.file.extra"))
method='curl', extra = 'insecure' #list("k", getOption("download.file.extra"), 'insecure')
)
When I try the curl/wget options I get errors that the file is too large.
href="https://drive.google.com/open?id=1_YtgWP2MAF7c4dW8naugP1RL3I-xB7G2">test.zip (158M) is too large for Google to scan for viruses. Would you still like to download this file?
Is there a way to force this to download from R like I could from curl or wget? Or is there any good way to download a large zipped file from google drive without requiring the googledrive
package? Or is there somewhere else I should store large files that are included in my R package.
UPDATE: I have decided instead to use dropbox to store the files. This is working seamlessly. I'm still interested if anyone has a solution to simply download big files from Google Drive within R.