item_upload_cloud: Upload File to Item Cloud Storage

View source: R/item_upload_files.R

item_upload_cloudR Documentation

Upload File to Item Cloud Storage

Description

Adds a file to an item in cloud storage

Usage

item_upload_cloud(
  sb_id,
  files,
  ...,
  status = TRUE,
  session = current_session()
)

Arguments

sb_id

An sbitem object or a character ScienceBase ID corresponding to the item

files

A string vector of paths to files to be uploaded

...

Additional parameters are passed on to GET, POST, HEAD, PUT, or DELETE

status

logical display upload status?

session

Session object from authenticate_sb. Defaults to anonymous or last authenticated session

Value

Success message invisibly. NOTE: cloud processing can take some time so the added file may not appear immediately. For this reason, a sciencebase item json is NOT returned as is done with other similar functions.

Examples

## Not run: 
res <- item_create(user_id(), "testing 123")
cat("foo bar", file = "foobar.txt")
item_upload_cloud(res$id, "foobar.txt")

## End(Not run)

sbtools documentation built on May 1, 2023, 1:07 a.m.