drop_download: Download a file from Dropbox to disk.

Description Usage Arguments Value References Examples

View source: R/drop_download.R

Description

Download a file from Dropbox to disk.

Usage

1
2
3
4
5
6
7
8
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

rdrop2 documentation built on Aug. 5, 2020, 5:07 p.m.

Related to drop_download in rdrop2...