Delete a File attached to a Record

Share:

Description

This function allows you to remove a document that has been attached to an individual record

Usage

1
2
3
4
5
6
7
8
deleteFiles(rcon, record, field, event, ...)

## S3 method for class 'redcapDbConnection'
deleteFiles(rcon, record, field, event, ...)

## S3 method for class 'redcapApiConnection'
deleteFiles(rcon, record, field, event, ...,
  proj = NULL)

Arguments

rcon

A REDCap connection object as generated by redcapConnection

record

The record ID in which the desired file is stored. Must be length 1.

field

The field name in which the file is stored. Must be length 1.

event

The event name for the file. Must be length 1. This applies only to longitudinal projects. If the event is not supplied for a longitudinal project, the API will return an error message.

...

Arguments to be passed to other methods

proj

A redcapProject object as created by redcapProjectInfo.

Author(s)

Benjamin Nutter

References

Please refer to your institution's API documentation.

Additional details on API parameters are found on the package wiki at https://github.com/nutterb/redcapAPI/wiki/REDCap-API-Parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
  > #*** Note: I cannot provide working examples without
  > #*** compromising security.  Instead, I will try to
  > #*** offer up sample code with the matching results
  >
  > #*** Create the connection object
  > rcon <- redcapConnection(url=[YOUR_REDCAP_URL], token=[API_TOKEN])
  >
  >
  > #* Delete a file
  > deleteFiles(rcon, record=1, field="file_upload", event="event_1_arm_1")
  The file was successfully deleted
  >
  
## End(Not run)