Skip to content
Jonathan Chan edited this page May 11, 2018 · 5 revisions

redcap-import-file uploads a file to a REDCap project.

Parameter Description
host Server hostname
token Authentication token (project and user specific!)
record Primary id of record
field Field variable name for which the file is uploaded
filename Filename of the file being uploaded. Include full path if needed.
xargs Optional parameters; see below

Optional parameters must come in pairs of 'symbol "string".

Optional Parameter Description
'form "[form]" Uploads to the record with the given form.
'event "[event]" Uploads to the record with the given event in longitudinal projects.
'repeat "[repeat]" Uploads to the record with the given instance number in projects with repeatable events.

Example

Example 1: Importing a file to a project.

> ;;Testing Import File function
> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-import-file redcap:hostname redcap:token "1" "file2" "data.csv" 'event "test_event_arm_1")
#f

Clone this wiki locally