Skip to content

Upload

Uploads the specified file to a remote environment.

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

Parameters

string id
    The ID of the file to upload.

FileTransferOptions options
    An instance of FileTransferOptions containing the transfer settings.

Remarks

If the Port number is specified, passive mode is automatically disabled. To enable passive mode, remove the Port number from the options.

Uploading a file via FTP to 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
The password to authenticate with on the remote environment. Optional.

Port : number
The port number of the remote environment. Optional.

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

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

RemotePath : string
The path of the file on the remote environment.

UserName : string
The username to authenticate with on the remote environment. Optional.