| << back to sysax.com Product page |
Connections to a remote FTP server are established using the ftpconnect command. The IP address of the remote server must be specified as the address string. The port number indicates the port where FTP connections are accepted by the remote server. The default port number for regular FTP connections is 21. The username and password strings are required to log into a specific user account. If the FTP server allows anonymous access, the username should be ftp and the password should be the user's email address. Some legacy FTP servers may also require an optional account string. The ftpresult predefined status flag is set to the predefined constant success if the command completed successfully.
The syntax is
Exhibit 3.1. table title
ftpconnect <address string>, <port number>, <username>, <password> [, optional: <account>]; |
Secure connections using the SSL protocol (also known as FTPS) are established using the ftpconnectssl command. The ftpconnectsslc command can be used if only the control connection needs to be encrypted using SSL.
The syntax is
Exhibit 3.2. table title
ftpconnectssl <address string>, <port number>, <username>, <password> [, optional: <account>]; ftpconnectsslc <address string>, <port number>, <username>, <password> [, optional: <account>]; |
Client side SSL certificates may be used for authentication of a client to the remote server. The certload command enables a client side certificate to be loaded. The certificate must be loaded before establishing a connection using ftpconnectssl and must be in the pem format.
The syntax is
Exhibit 3.3. table title
certload <certificate file>, <private key file> [, optional: <passphrase>]; |
Secure connections using the SSH protocol (also known as SFTP) are established using the ftpconnectssh command. The default port number for ssh connections is 22.
The syntax is
Exhibit 3.4. table title
ftpconnectssh <address string>, <port number>, <username>, <password> [, optional: <account>]; |
Public key authentication for SSH connections allows clients to use a private key for authentication instead of a password. The pkeyload command enables a private key to be loaded to perform SSH public key authentication. The key must be loaded before establishing a connection using ftpconnectssh and must be in the pem format.
The syntax is
If it is necessary to connect using a http proxy server, the proxyhttp command should be called before establishing a connection.
The syntax is
Exhibit 3.6. table title
proxyhttp <proxy address>, <proxy port> [, optional: <proxy username>, <proxy password>]; |
The ftpdisconnect command is used to close a connection that was established using any of the above commands.
The syntax is
Some examples are
Exhibit 3.8. table title
ftpconnect "ftp.mysite.com", 21, "username", "password"; #connect to a non-secure ftp server if success eq ftpresult begin end certload "c:\\certs\\mycert.pem", "c:\\keys\\myprivkey.pem", "keypass"; ftpconnectssl "ftp.securesite.com", 21, "user", "pass"; # connect to an SSL (FTPS) based secure server using client side certificate pkeyload "c:\\keys\\privkey.pem", "keypass"; ftpconnectssh "ftp.securesite.com", 22, "", ""; #connect to an SSH (SFTP) based secure server using public key auth ftpdisconnect; #disconnect from the remote ftp server |