Skip to content

Upload

Uploads the specified file to remote environment.

1
myFiles.Upload(id: string, options: FileTransferOptions):void

Parameters

string id
    Id number of file to upload

FileTransferOptions options
    Instance of FileTransferOptions

Remarks

If port number is specified passive mode is automatically disabled, to enable it please remove the port number from options.

Uploading file via FTP into a folder located on a remote server

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
var fileId = $Xml.Evaluate('File/FileId');

var fileTransferOptions = {
    RemoteHost : '192.168.1.28',
    RemotePath : 'testfolder/testdoc.pdf',
    Username : 'myUsername',
    Password : 'myPassword',
    Protocol : 'FTP'
};

$Files.Upload(fileId, fileTransferOptions);

Types

FileTransferOptions

Options for file transfer operations.

Password : string
Password to authenticate on remote environment. Optional.

Port : number
Port number of remote environment. Optional.

Protocol : ( "FTP" | "FTPS" | "SFTP" | "HTTP" | "HTTPS" )
Protocol to use for file transfer. Optional. Default is FTP.

RemoteHost : string
IP address or host name of remote environment.

RemotePath : string
Path of file on remote environment.

UserName : string
Username to authenticate on remote environment. Optional.