Method FTPClient2():new() Foundation

Initialize a new FTP client instance.

Syntax
:new( <cUrl>, [<cUsername>], [<cPassword>], [<cProxyUrl>] ) --> self
Parameters
<cUrl>
The URL of the FTP server (e.g., "ftp://example.com" or "ftps://example.com"). The URL must contain either the "ftp://" or the "ftps://" scheme prefix. Otherwise, a runtime error is raised. When using a non-standard port, the port number must be specified in the URL (e.g., "ftp://example.com:2121" or "ftps://example.com:990").
<cUsername>
An optional username for authentication. Depending on the ftp server the username can be case-sensitive.
<cPassword>
An optional password for authentication.
<cProxyUrl>
An optional URL of a proxy server.
Return

This method returns self.

Description

Creates and initializes a new FTP client instance for connecting to the specified server.

If a username and password is given, these credentials will be used to authenticate the specified user when connecting to the server using :connect(). When username and password are not specified, anonymous FTP login is used.

After creating the instance, you can set additional options using :setOption() before establishing the connection with :connect().

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.