Discuss this help topic in SecureBlackbox Forum

FTPS: Initiate the connection

To use FTP or FTPS client connection, you need to use TElSimpleFTPSClient class.

First, you need to set Address and Port properties of TElSimpleFTPSClient class. These properties specify the address and port of the remote server, to which the client will connect.

Next you need to specify Username and Password, used to login to the remote server, using the corresponding properties.

It is important to specify whether the FTP connection uses Active or Passive mode. This is done by setting PassiveMode property to false or true. In Active mode, when the client establishes data connection, it just opens the port and waits for the server to connect. In Passive mode the server opens the socket, to which the client connects. Active mode usually doesn't work if the client is behind the NAT or firewall. When using passive mode, if the server is behind the firewall, it can report incorrect address to connect to. In this case you need to set AdjustPasvAddress property to true.

If you plan to use SSL/TLS (i.e. FTPS), see the corresponding how-to article.

If you want to use compression (when it is supported by the server), see the corresponding how-to article.

Call Open() method of TElSimpleFTPSClient class to initiate connection. The method returns when the connection is established. If an error happens during connection establishment, the exception is thrown.

After the connection is established, call Login() method to login. The method is synchronous, i.e. it returns when the operation is completed. If an error happens, the exception is raised.

After logging in, you can perform FTP-specific operations.

For description of FTP(S) error handling see the corresponding how-to article.

How To articles about client-side FTPS questions

Discuss this help topic in SecureBlackbox Forum