attachFile Attaches a file to entity identified by barcode. Note: This function uses the JSON API.

attachFile(coreApi, barcode, filename, filepath,
  targetAttributeName = "", useVerbose = FALSE)

Arguments

coreApi

coreApi object with valid jsessionid

barcode

User provided barcode as a character string

filename

name to use for the attached file

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.

useVerbose

Use verbose communication for debugging

Value

RETURN returns a list $entity contains entity information, $response contains the entire http response

Details

attachFile Attaches a file to an entity or file attribute.

Examples

# NOT RUN {
api<-CoreAPI("PATH TO JSON FILE")
login<- CoreAPI::authBasic(api)
modifiedItem<-CoreAPI::attachFile(response$coreApi,barcode,filename,
         filepath,targetAttributeName="",useVerbose=FALSE)
CoreAPI::logOut(login$coreApi )
# }