
There are several ways to download files from Google Drive. Whether you are trying to download files from a Windows computer or a Mac, restart your PC once before jumping onto the other solutions. This version skips files already downloaded.Let’s get started with solutions. Path = str_c(files$name, "/", i_dir$name) This code works for me: #load the libraries A proper recursive function needs to be written and implemented in the package. If one changes the code to that, and adds the required loops, one can automatically download the contents of the sub-dirs. The error message is misleading (it would be nice if it simply told the user to give it a data frame). However, when one attempts to get the contents of the subdir, it throws this error: > i_dir = drive_ls(files$id)Įrror: 'path' does not identify at least one Drive file.Īctually, it is simple: drive_ls() wants a data frame input with 1 row, not a character vector. The files object seems fine (replacing the strings with fillers): # A tibble: 6 x 3 Walk(i_dir$id, ~ drive_download(as_id(.x))) #loop dirs and download files inside them Here's my attempt at avoiding this issue by going into each subdir: #load the libraries Unfortunately, this doesn't work because it apparently cannot deal with folders: > drive_download(folder_id)Įrror: Not a recognized Google MIME type: The most obvious command to try is simply telling it to download the folder, hoping it will figure out the substructure: #load the libraries In my case, there are only two layers, but it would be nice with an approach that works for arbitrary number of layers. So I want to recurse into the sub-directories and get all files from each. I have a folder shared with me with some large files.

There are some prior related questions ( 1, 2, 3), but nothing quite what I want, and I can't get the code example to work that Jenny Bryan posted in 2018.
