Skip to main content
Version: v6.7.0

Upload file

Command Description​

Upload a locally designated single file to the file transfer service of the Commander

Command Prototype​

uploadStatus = CommanderFileService.UploadFile(sRemotedir,sFilepath,bCover)

Command parameter​

parametermandatorytypedefault valueInstructions
sRemotedirTruestring""Existing folders in file transfer service
sFilepathTruepath''' C:\Users'''Specify the path of the locally uploaded file, the file size cannot exceed 4GB, and the file format cannot be in exe format
bCoverTruebooleanTrueWhen uploading files to a remote folder, if a file with the same name already exists, select 'Yes' to overwrite it, select' No 'to cancel the upload, and return False

Return result​

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

Run instance​

/*********************************Upload File****************************************
Command Prototype:
uploadStatus = CommanderFileService.UploadFile(sRemotedir,sFilepath,bCover)
Input Parameters:
sRemotedir -- Remote folder. Note: An existing folder in the file transfer service.
sFilepath -- Local file. Note: Specify the path of the local file to be uploaded. The file size cannot exceed 4GB, and the file format cannot be exe.
bCover -- Whether to overwrite. Note: When uploading a file to the remote folder, if a file with the same name already exists, select "Yes" to overwrite, or "No" to cancel the upload and return False.
Output Parameter:
uploadStatus -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim uploadStatus = ""
uploadStatus = CommanderFileService.UploadFile("",'''C:\Users''',True)
TracePrint(uploadStatus)