Export a Listing of Folders and Files in the File Repository
Export a Listing of Folders and Files in the File Repository
This method enables the user to export a list of folders and files saved to the File Repository. The listing may optionally include contents of subfolders.
exportFileRepositoryListing( rcon, folder_id = numeric(0), recursive =FALSE,...)## S3 method for class 'redcapApiConnection'exportFileRepositoryListing( rcon, folder_id = numeric(0), recursive =FALSE,...)
Arguments
rcon: A redcapConnection object.
folder_id: integerish(0/1). The folder ID of a specific folder in the File Repository for which a list of files and subfolders will be exported. By default, the top-level directory of the File Repository will be used.
recursive: logical(1). When TRUE, content of subfolders will be retrieved until a full listing is produced. If FALSE, only the contents of the requested folder will be returned.
...: Arguments to pass to other methods
Returns
Returns a data frame with the columns
folder_id
The REDCap assigned ID value for the folder. Will be NA if the item is a file.
doc_id
The REDCap assigned ID value for the file. Will be NA if the item is a folder.
name
The name of the folder of file.
parent_folder
The ID of the parent folder of the item. The top-level folder is represented as 0.
Examples
## Not run:unlockREDCap(connections = c(rcon ="project_alias"), url ="your_redcap_url", keyring ="API_KEYs", envir = globalenv())# Export the top-level listing of the File RepositoryexportFileRepositoryListing(rcon)# Export the complete listing of the File RepositoryexportFileRepositoryListing(rcon, recursive =TRUE)# Export the listing of a subfolder in the File RepositoryexportFileRepositoryListing(rcon, folder_id =12345)## End(Not run)