DownloadFromCloud
Structure
DownloadFromCloud(sService, sFileName, sFolder, sToDirectory: Text; bAllowAuth: Boolean): Text
Type
Function
Description
This function will attempt a download of the sFileName file from the Cloud account specified in the sService. The file will be copied to the sToDirectory after download. If the sFolder parameter is set then the file will be downloaded from the specified cloud folder. This folder must be one level above the root directory. If no sFolder is specified then the file will be downloaded from the root directory. The function will return 'SUCCESS' if the download is successful, otherwise the error condition is returned. Upon execution, if no token exists for the cloud service AND bAuth parameters is True then the service's login screen will be shown in a browser window. This token will be remembered for future sessions.
Parameters: 5
sFileName = Name of file to be downloaded from Cloud service. The file must exist in the root directory of the cloud storage.
sService = the name of the online cloud service. Acceptable values are: 'BOX' (box.com) and 'DROPBOX' (dropbox.com)
sFolder = the folder in the online cloud service where the file should be downloaded. If none is specified then the file will be downloaded from the root directory.
sToDirectory = the name of the local directory where the file should be copied after download from the cloud
bAllowAuth = If previous tokens saved to the database are not found and/or do not allow access to the online service, this parameter determines if a browser window should be shown to allow for credentials to be entered. If this script is intended to be run in an automated/unattended setup, then this parameter should be set to False.
Return Value
Text
Examples
sFileName = "ABC COMPANY-ABC123.ZIP"
sResult = DownloadFromCloud("DROPBOX", sFileName, "", "C:\Temp\Downloaded", True)
if sResult = "SUCCESS" then
ShowMessage("Download complete: " & sFileName)
Else
ShowMessage("Download was not completed: " & sFileName & Chr(13) & sResult)
End If |