Learn R Programming

redcapAPI (version 2.10.0)

exportFileRepositoryListing: Export a Listing of Folders and Files in the File Repository

Description

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.

Usage

exportFileRepositoryListing(
  rcon,
  folder_id = numeric(0),
  recursive = FALSE,
  ...
)

# S3 method for redcapApiConnection exportFileRepositoryListing( rcon, folder_id = numeric(0), recursive = FALSE, ... )

Value

Returns a data frame with the columns

folder_idThe REDCap assigned ID value for the folder. Will be NA if the item is a file.
doc_idThe REDCap assigned ID value for the file. Will be NA if the item is a folder.
nameThe name of the folder of file.
parent_folderThe ID of the parent folder of the item. The top-level folder is represented as 0.

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

See Also

exportFromFileRepository(),
importToFileRepository(),
deleteFromFileRepository(),
exportFileRepository(),
importFileRepository(),
deleteFileRepository(),
createFileRepositoryFolder()

Examples

Run this code
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Export the top-level listing of the File Repository
exportFileRepositoryListing(rcon)

# Export the complete listing of the File Repository
exportFileRepositoryListing(rcon, 
                            recursive = TRUE)
                            
# Export the listing of a subfolder in the File Repository
exportFileRepositoryListing(rcon, 
                            folder_id = 12345)
}

Run the code above in your browser using DataLab