Skip to content

Upload

Uploads the specified file to a remote environment.

1
myFiles.Upload(id: string, options: `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.):void

Parameters

string id
    The ID of the file to upload.

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. 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.

Upload a repository file to an FTP 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);

See Also