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)
The box.com id for the file that you'd like to download
A file path to a local directory which you'd like the file to be downloaded to.
logical. Should existing files with the same name be
overwritten?
Optional. An alternate filename for the local version of the
file. The default, NULL, uses the name from box.com.
If downloading an older version, the version_id of
the desired file
The version of the file you'd like to download (starting at 1)
Should a progress bar be shown? (via
setTxtProgressBar)
If uploading, the box.com folder id that you'd like to upload to.
the path to the local file that you'd like to upload (if there is one)
Optional. 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
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.