Upload a new version of a project, given a staging directory containing files and their metadata.

uploadProject(
  dir,
  url,
  project,
  version,
  files = list.files(dir, recursive = TRUE),
  ...,
  permissions = list(),
  upload.args = list(),
  complete.args = list(),
  user.agent = NULL
)

Arguments

dir

String containing the path to a project directory on the file system, containing files to be uploaded.

url

String containing the URL to the REST API.

project

String containing the project name.

version

String containing the version.

files

Character vector of paths to files to be uploaded within dir. These should be relative to dir.

...

Further arguments to pass to initializeUpload.

permissions

A list containing permission information, see getPermissions. This usually contains the owners and viewers character vectors.

upload.args

Further arguments to pass to uploadFiles.

complete.args

Further arguments to pass to completeUpload.

user.agent

String containing a user agent string. If NULL, a default user agent is used.

Value

On success, NULL is returned invisibly.

Details

Use of this function will almost always require appropriate authentication/authorization with the target API. Developers should ensure that identityHeaders and friends are set accordingly.

Users should consider setting expires in ... when testing uploads, to avoid creating a permanent copy of test files. Check out ?initializeUpload for more details.

Advanced users can reduce upload bandwidth and storage footprint by creating links to duplicate files between versions or projects. Check out ?initializeUpload for more details.

See also

uploadFiles and related functions, for the internal utilities.

Author

Aaron Lun

Examples

# Creating a mock project.
src <- system.file("scripts", "mock.R", package="zircon")
source(src)
tmp <- tempfile()
createMockProject(tmp)

# Performing a basic upload:
if (FALSE) {
uploadProject(tmp, example.url, "test-zircon-upload", "foobar", expires=1)
}