box_dl {boxr}R Documentation

Download/upload files from/to Box

Description

box_dl()

download a file from Box to a local directory

box_ul()

upload a local file to a Box folder

Usage

box_dl(
  file_id,
  local_dir = getwd(),
  overwrite = FALSE,
  file_name = NULL,
  version_id = NULL,
  version_no = NULL,
  pb = options()$boxr.progress,
  filename
)

box_ul(
  dir_id = box_getwd(),
  file,
  pb = options()$boxr.progress,
  description = NULL
)

Arguments

file_id

numeric or character, file ID at Box.

local_dir

character, path to local directory.

overwrite

logical, indicates that newer files at origin will overwrite older files at destination.

file_name

character, if supplied, an alternate filename for the local version of the Box file.

version_id

character or numeric, the version_id of the file.

version_no

numeric, version of the file you'd like to download (starting at 1).

pb

logical, indicates to show progress bar (via setTxtProgressBar()).

filename

character, deprecated: use file_name instead.

dir_id

numeric or character, folder ID at Box.

file

character, local path to the file.

description

character, description caption for the file.

Value

box_dl()

character, local path to the downloaded file.

box_ul()

Object with S3 class boxr_file_reference.

Versions

box_dl() can accept one of two parameters to specify file versions: version_id or version_no.

The box.com API refers to file versions using 11 digit ids (which can be accessed via box_version_history()) - you can specify these using the version_id parameter.

However, this isn't terribly intuitive. As a result, box_dl() provides the version_no parameter, which accepts a whole number, and corresponds to the versions that you'll see via the web UI. For example to download the version marked 'V2' on box.com, specify version_no = 2. This works by making an internal call to box_version_history() to retrieve the version_id, which makes it slightly slower.

See Also


[Package boxr version 0.3.6 Index]