I'm working on transferring a legacy project with many file attachments to a new REDCap build and using the exportFiles() function to export the files. I’m running into an issue where I receive the following error message:
400: ERROR: There is no file to download for this record, even though the files do exist.
For example, this works:
library(redcapAPI)
files <- exportFiles(source_project, record = "10", field = "upload_1", instance = 1) # Success
But this fails:
files <- exportFiles(source_project, record = "1", field = "upload_1", instance = 2) # Fails
Both records are from the same instrument, and I’m sure the files exist.
exportFiles()function comes from theredcapAPIpackage, addlibrary(redcapAPI). Assuming the field "upload_1" exists on a repeating instrument, are you sure that every repeat instance has a file uploaded? For instance, what doesexportFiles(source_project, record = "10", field = "upload_1", repeat_instance = 2)return?