Skip to main content
Version: v6.5.0

Download file

Command Description

Download the specified single file from the file transfer service of the Commander to the local folder

Command Prototype

filePath = CommanderFileService.DownloadFile(sRemotefile,sLocalpath,bCover)

Command parameter

parametermandatorytypedefault valueInstructions
sRemotefileTruestring""The file path specified in the file transfer service
sLocalpathTruepath''' C:\Users'''Save to local folder path
bCoverTruebooleanFalseWhen saving locally, if a file with the same name already exists in the path, select 'Yes' to overwrite it, and select' No 'to automatically rename it

Return result

FilePath, Assign the result of running the command to this variable.

Run instance

/*********************************Download File****************************************
Command Prototype:
filePath = CommanderFileService.DownloadFile(sRemotefile,sLocalpath,bCover)
Input Parameters:
sRemotefile -- Remote file. Note: The specified file path in the file transfer service.
sLocalpath -- Download path. Note: The local folder path where the file will be saved.
bCover -- Whether to overwrite. Note: When saving to local, if a file with the same name already exists in the path, select "Yes" to overwrite, or "No" to automatically rename.
Output Parameter:
filePath -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim filePath = ""
filePath = CommanderFileService.DownloadFile("",'''C:\Users''',False)
TracePrint(filePath)