Rlabkey (version 2.8.0)

labkey.webdav.get: Download a file via WebDAV

Description

This will download a file from a LabKey Server using WebDAV.

Usage

labkey.webdav.get(
    baseUrl=NULL,
    folderPath,
    remoteFilePath,
    localFilePath,
    overwrite=TRUE,
    fileSet='@files'
    )

Arguments

baseUrl

a string specifying the baseUrl for the labkey server

folderPath

a string specifying the folderPath

remoteFilePath

the path of this file on the remote server, relative to the folder root.

localFilePath

the local filepath where this file will be saved

overwrite

(optional) if true, any pre-existing file at this location will be overwritten. Defaults to TRUE

fileSet

(optional) the name of file server fileSet, which is typically "@files" (the default value for this argument). In some cases this might be "@pipeline" or "@fileset".

Value

TRUE or FALSE, depending on if this file was downloaded and exists locally. Will return FALSE if the already file exists and overwrite=F.

Details

Download a single file from a LabKey Server to the local machine using WebDAV.

See Also

labkey.webdav.put, labkey.webdav.mkDir, labkey.webdav.mkDirs, labkey.webdav.pathExists, labkey.webdav.listDir, labkey.webdav.delete, labkey.webdav.downloadFolder

Examples

Run this code
# NOT RUN {
## download a single file from a LabKey Server
library(Rlabkey)

labkey.webdav.get(
    baseUrl="http://labkey/",
    folderPath="home",
    remoteFilePath="folder/myFile.txt",
    localFilePath="myDownloadedFile.txt",
    overwrite=TRUE
)

# }

Run the code above in your browser using DataCamp Workspace