item_append_files: Upload File to Item

View source: R/item_upload_files.R

item_append_filesR Documentation

Upload File to Item

Description

Adds a file to an item

Usage

item_append_files(
  sb_id,
  files,
  ...,
  scrape_files = 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

scrape_files

logical should the files be scraped for metadata? If TRUE, sciencebase will attempt to create extensions based on the files.

For example, for shapefiles, this will result in a shapefile extension to be returned as a facet of the sciencebase item. See item: "58069258e4b0824b2d1d422e" for an example.

session

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

Value

An object of class sbitem

Examples

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

## End(Not run)

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