Files.download {SciServer} | R Documentation |
Downloads a file from the remote file system into the local file system, or returns the file content as an object in several formats.
Jobs.download(fileService, path, localFilePath=NULL, format="txt", quiet=TRUE)
fileService |
name of fileService (string), or object (list) that defines a file service. A list of these kind of objects available to the user is returned by the function Files.getFileServices(). |
path |
String defining the path (in the remote file service) of the file to be downloaded, starting from the root volume level. Example: rootVolume/userVolumeOwner/userVolume/fileToBeDownloaded.txt. |
localFilePath |
local destination path of the file to be downloaded. If set to NULL, then an object of format 'format' will be returned. |
format |
name (string) of the returned object's type (if localFilePath is not defined). This parameter can be "txt" , "raw" or "response". If the parameter 'localFilePath' is defined, then the 'format' parameter is not used and the file is downloaded to the local file system instead. |
quiet |
If set to FALSE, it will throw an error if the file does not exist. If set to TRUE. it will not throw an error. |
If the 'localFilePath' parameter is defined, then it will return TRUE when the file is downloaded successfully in the local file system. If the 'localFilePath' is not defined, then the type of the returned object depends on the value of the 'format' parameter.
Manuchehr Taghizadeh-Popp
Maintainer: Manuchehr Taghizadeh-Popp <mtaghiza@jhu.edu>
http://www.sciserver.org
http://apps.sciserver.org
http://apps.sciserver.org/dashboard/files
http://www.github.com/sciserver/SciScript-R
Files.getFileServices
, Files.getFileServiceFromName
,
Files.delete
, Files.createDir
,
Files.upload
, Files.dirList
, Files.createUserVolume
fileServices = Files.getFileServices(); isDownloaded = Files.download(fileServices[[1]], path="rootVolume/userVolumeOwner/userVolume/fileToBeDownloaded.txt", localFilePath="/myUploadedFile.txt");