importFiles: Imports a File to REDCap to Attach to a Record

Description Usage Arguments Details Author(s)

View source: R/importFiles.R

Description

A single file may be attached to a single record. The behavior of this function is consistent with the behavior of the API, which only allows one file to be uploaded at a time

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
importFiles(rcon, file, record, field, event, overwrite = TRUE, ...,
  bundle = NULL)

## S3 method for class 'redcapDbConnection'
importFiles(rcon, file, record, field, event,
  overwrite = TRUE, ..., bundle = NULL)

## S3 method for class 'redcapApiConnection'
importFiles(rcon, file, record, field,
  event = NULL, overwrite = TRUE, ..., bundle = NULL,
  error_handling = getOption("redcap_error_handling"))

Arguments

rcon

A REDCap connection object as generated by redcapConnection

file

Character string giving the file path to the file to be imported.

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

overwrite

Logical. When FALSE, the function checks if a file already exists for that record. If a file exists, the function terminates to prevent overwriting. When TRUE, no additional check is performed.

...

Arguments to be passed to other methods

bundle

A redcapBundle object as created by exportBundle.

error_handling

An option for how to handle errors returned by the API. see redcap_error

Details

The function may only import a single file

Author(s)

Benjamin Nutter


redcapAPI documentation built on May 12, 2018, 1:05 a.m.