Functions to download (box_dl), and upload (box_ul).
box_dl takes the id of a file hosted on box.com, downloads
it and writes it to disk.
box_ul uploads a file stored locally to a specified box.com folder.
If a file with the same name already exists, it will upload the file as
a new version.
box_dl(file_id, local_dir = getwd(), overwrite = FALSE, filename = NULL, version_id = NULL, version_no = NULL, pb = options()$boxr.progress)
box_ul(dir_id = box_getwd(), file, pb = options()$boxr.progress, description = NULL)logical. Should existing files with the same name be
overwritten?NULL, uses the name from box.com.version_id of
the desired filesetTxtProgressBar)character. A string to be used as the
description caption for the file (added via
box_add_description). Useful for describing the contents of a
file, or describing the latest changes made to it. If NULL (the
default), no description is added.box_dl returns the path of the newly downloaded file if successful,
and throw an error otherwise.box_ul will return an object of class
boxr_file_reference
box_dl can accept one of two parameters to specify file versions:
version_id and version_no. The box.com API refers to file versions using 11 digit ids (which can be
accessed via box_previous_versions) - you can specify these
using the version_id parameter. However, this isn't terribly intuative. 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_previous_versions to retrieve the version_id,
which makes it slightly slower.
box_fetch and box_push for
directory-wide equivalents, box_delete_file for removing
uploaded files, box_source for R code, and
box_save/box_load for remote R objects.