Method FTPClient2():connect() Foundation

Establishes a connection.

Syntax
:connect( [<cMode>] ) --> lSuccess
Parameters
<cMode>
The optional connection mode, either "active" or "passive". The default mode is "passive".
Return

.T. (true) if the connection is established successfully, .F. (false) otherwise.

Description

Establishes a connection to the FTP server using the provided connection mode. The connection mode can be either "active" or "passive". In passive mode, the client initiates all connections, which is useful when the client is behind a firewall. In active mode, the server connects back to the client for data transfers. The default mode is "passive".

If the connection fails, use :getLastError() and :getLastMessage() methods to obtain detailed error information. Common failure reasons include network issues, invalid credentials, or server unavailability.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.