drop_download: Download a file from Dropbox to disk.

View source: R/drop_download.R

drop_downloadR Documentation

Description

Download a file from Dropbox to disk.

Usage

drop_download(
  path,
  local_path = NULL,
  overwrite = FALSE,
  progress = interactive(),
  verbose = interactive(),
  dtoken = get_dropbox_token()
)

Arguments

path

path to a file in Dropbox

local_path

path to save file to. If NULL (the default), saves file to working directory with same name. If not null, but a valid folder, file will be saved in this folder with same basename as path. If not null and not a folder, file will be saved to this path exactly.

overwrite

If TRUE, overwrite local file. Defaults to FALSE

progress

If TRUE, show a progress bar for large file downloads. Defaults to TRUE in interactive sessions, otherwise FALSE.

verbose

if TRUE, emit message giving location and size of the newly downloaded file. Defaults to TRUE in interactive sessions, otherwise FALSE.

dtoken

The Dropbox token generated by drop_auth. rdrop2 will try to automatically locate your local credential cache and use them. However, if the credentials are not found, the function will initiate a new authentication request. You can override this in drop_auth by pointing to a different location where your credentials are stored.

Value

TRUE if successful; error thrown otherwise.

References

API documentation

Examples

## Not run: 

  # download a file to the current working directory
  drop_get("dataset.zip")

  # download again, overwriting previous result
  drop_get("dataset.zip", overwrite = TRUE)

  # download to a different path, keeping file name constant
  # will download to "some/other/place/dataset.zip"
  drop_get("dataset.zip", local_path = "some/other/place/")

  # download to to a different path, changing filename
  drop_get("dataset.zip", local_path = "some/other/place/not_a_dataset.zip")

## End(Not run)


karthik/rdrop2 documentation built on March 28, 2024, 5:51 a.m.