View source: R/docsFromFileRepository.R
fromFileRepositoryMethods | R Documentation |
These methods enable the user to export, import, or delete individual files from a REDCap project's file repository.
exportFromFileRepository(rcon, doc_id, dir = getwd(), dir_create = FALSE, ...)
importToFileRepository(rcon, file, folder_id = numeric(0), ...)
deleteFromFileRepository(rcon, doc_id, ...)
## S3 method for class 'redcapApiConnection'
exportFromFileRepository(rcon, doc_id, dir = getwd(), dir_create = FALSE, ...)
## S3 method for class 'redcapApiConnection'
importToFileRepository(rcon, file, folder_id = numeric(0), ...)
## S3 method for class 'redcapApiConnection'
deleteFromFileRepository(rcon, doc_id, ...)
rcon |
A |
doc_id |
|
folder_id |
|
file |
|
dir |
|
dir_create |
|
... |
Arguments to pass to other methods |
When a file is deleted, the file will remain in the Recycle Bin folder for up to 30 days.
exportFromFileRepository
, importToFileRepository
,
and deleteFromFileRepository
each return a data frame
with the columns:
directory | The directory in which the file is saved. |
filename | The name of the saved file. |
exportFromFileRepository()
: Export a file from the file repository.
importToFileRepository()
: Import a file to the file repository.
deleteFromFileRepository()
: Delete a file from the file repository.
exportFileRepository()
,
importFileRepository()
,
deleteFileRepository()
,
exportFileRepositoryListing()
,
createFileRepositoryFolder()
## Not run:
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
write_to_path <- tempdir()
# Export a file from the repository
exportFromFileRepository(rcon,
doc_id = 12345,
dir = write_to_path)
# Export a file and create the target directory if it does not exist
exportFromFileRepository(rcon,
doc_id = 12345,
dir = write_to_path,
dir_create = TRUE)
# Import a file to the top-level directory of the file repository
importFileToRepository(rcon,
file = "file_to_import.txt")
# Import a file to a specific directory of the file repository
importFileToRepository(rcon,
file = "file_to_import.txt",
folder_id = 678)
# Delete a file from the file repository
deleteFileFromRepository(rcon,
doc_id = 12345)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.