download_nextcloud_files | R Documentation |
Helper Function: Download Nextcloud Files from a Directory
download_nextcloud_files( dir_cloud, dir_local, file_pattern = "Project\\.xls$" )
dir_cloud |
directory on Nextcloud |
dir_local |
directory on local computer. If not existing it will be created |
file_pattern |
file pattern to be used as download filter (default: "Project\.xls$") |
downloads all files from cloud into local folder fullfilling file_pattern
and returns the file
, i.e. filename
## Not run: #1 Open RStudio and run usethis::edit_r_environ() #2 In the opened window add the required environment variables ### NEXTCLOUD_URL = "https://<replace-with-nextcloud-cloud-url>" ### NEXTCLOUD_USER = "<your-nextcloud-username>" # your username ### NEXTCLOUD_PASSWORD = "your-nextcloud-app-password" ### see details below #3 For creating <your-nextcloud-app-password>: #3.1 go to: https://replace-with-nextcloud-url/index.php/settings/user/security #3.2 scroll down to create new app password #3.3 select a name e.g. r-script and copy the token and replace your-nextcloud-app-password #4 Finally you need to restart Rstudio and proceed with the code below: paths_list <- list(site_code = "Pilot_A", common_path = "ultimate/raw_data_pilots/<site_code>/data", dir_cloud = "projects/<common_path>", dir_local = "C:/kwb/projects/<common_path>") paths <- kwb.utils::resolve(paths_list) download_nextcloud_files(dir_cloud = paths$dir_cloud, dir_local = paths$dir_local, file_pattern = "Project\\.xls$" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.