attachFile: attachFile - Attaches a file to an entity or file attribute.

Description Usage Arguments Details Value Author(s) Examples

View source: R/attachFile.R

Description

attachFile Attaches a file to entity identified by barcode. Note: This function uses the JSON API to post a file to an entity and Odata to post to an attribute.

Usage

1
2
attachFile(coreApi, entityType, barcode, filePath,
  targetAttributeName = "", ...)

Arguments

coreApi

coreApi object with valid jsessionid

entityType

PFS entity type

barcode

User provided barcode as a character string

filePath

path to the file to attach

targetAttributeName

- if included the name if the attribute to attach the file to. Must be in all caps.

...

additional arguments passed to apiPUT

Details

attachFile Attaches a file to an entity or file attribute.

Value

List of length 2, containing content and response objects:

Author(s)

Craig Parman info@ngsanalytics.com

Adam Wheeler adam.wheeler@thermofisher.com

Scott Russell scott.russell@thermofisher.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
api <- coreAPI("PATH TO JSON FILE")
login <- authBasic(api)
modifiedItem <- attachFile(login$coreApi,
  entitytype,
  barcode,
  filePath,
  targetAttributeName = "",
  useVerbose = FALSE
)
logOut(login$coreApi)

## End(Not run)

AmundsenJunior/pfsrsdk documentation built on July 18, 2019, 8:10 p.m.