fs_upload: Upload file to an article

View source: R/fs_upload.R

fs_uploadR Documentation

Upload file to an article

Description

Upload file to an article

Usage

fs_upload(article_id, file, session = fs_get_auth())

Arguments

article_id

an article id number or a character string (or list) of numbers

file

path to file to upload, or character string (or list) of files (paths)

session

the authentication credentials from fs_auth (optional)

Details

Articles may be draft, private or public but all uploads are saved as draft changes - the canonical public version of the deposit is not updated. To update the public version of the repository, use fs_make_public. Only articles of type "fileset" can have multiple files uploaded.

If only a single id number is given but a character string of files is given, then be sure that the id corresponds to an object of type "fileset". If article_id list has more than one id, then there must be a corresponding file path for each id.

Author(s)

Carl Boettiger cboettig@gmail.com

References

http://api.figshare.com

See Also

fs_auth

Examples

## Not run: 
id <- fs_create("Title", "description", "figure")
fs_upload(id, "file.png")

## End(Not run) 

ropensci/rfigshare documentation built on May 18, 2022, 6:34 p.m.