item_upload_create: #' Upload file(s) and create a new item

View source: R/item_upload_files.R

item_upload_createR Documentation

#' Upload file(s) and create a new item

Description

Create a new item with files attached, all in one call to SB

Usage

item_upload_create(parent_id, files, ..., scrape_files = TRUE)

Arguments

parent_id

An sbitem object or character ScienceBase ID corresponding to the parent item (folder)

files

A string vector of paths to files to be uploaded

...

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

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.

Value

An object of class sbitem

Examples

## Not run: 
# You'll need a parent id for a folder/item
## here, using your highest level parent folder
file <- system.file("examples", "books.json", package = "sbtools")
item_upload_create(user_id(), file)

## End(Not run)

USGS-R/sbtools documentation built on June 1, 2024, 9:47 p.m.