fsClientInit

Creates an FTP client.

Syntax:

fsClientInit( host, port, user-name, password [, protocol] )

Parameters:

(s) host: FTP server domain name including sub domains.

(i) port: FTP command port - usually port 21.

(s) user-name: name of user account on server.

(s) password: password for user account on server.

(i) protocol: [optional] @fsFTPES, @fsFTPS, or @fsFTP.

Returns:

(s) client-handle: An FTPS extender client handle used by the other extender functions. 

FsClientInit creates an FTPS extender client handle. The client handle is the first parameter to most of the other function in this extender. It can be used multiple times with any extender function that takes it as a parameter. The handle becomes invalid once the fsClientDelete function is called on the handle or called to delete all handles.

 

host

Place the full domain name part of an FTP server's URL in this parameter. Do not include the namespace part of the server URL.

 

port

Use this parameter to indicate the port number of the FTP server's command channel. Almost all servers use port 21 unless the server still uses the deprecated  implicit FTPS protocol. If implicit FTP (@fsFTPS)  is used,  you likely need to use port 990.

 

user-name

 This parameter is used to indicate the name associated with an FTP server's user account that has sufficient privileges to perform tasks executed by other extender functions. Some servers require a domain name as part of the user name so they can perform domain based authentication. For example, "ftp.example.com|examuser" where the server domain name is  "ftp.example.com" and the user account name is "examuser". Notice that the two parts are separated by a vertical bar(|). This separator character my vary because it is depended on the server's FTP implementation.

 

password  

Use this parameter to provide the password associated with the user-name user account.

 

protocol

An optional parameter used to indicate FTP protocol to use. The default is @fsFTPES.

 

Use one of the following extender defined constants as a value:

 

Protocol

Meaning

@fsFTPES (2)

(default) Use the explicit FTPS protocol. Best choice and supported by most servers.

@fsFTPS (1)

Use implicit FTPS protocol. This protocol is deprecated and should only be used when a server does not support explicit FTPS

@fsFTP (0)

Unencrypted FTP protocol. Only use when FTPS is not supported.

Note that the WinInet extender supports more functionality with the plain FTP protocol.

 

Example:
  AddExtender('ilcfs44i.dll',0,'ilcfs64i.dll'
  host = 'test.example.com'
  port = 21
  user = 'demo'
  pwd  = 'password'
  
  ; 1. Use the default protocol (@fsFTPES)
  client = fsClientInit(host, port, user, pwd)
  
  ; Perform file and directory tasks as needed...
  
  ; Disconnect the client and free extender resources
  fsClientDelete(client)
  
  ; 1. Use the deprecated implicit FTPS protocol (@fsFTPS)
  port = 990
  client = fsClientInit(host, port, user, pwd, @fsFTPS)
  
  ; Perform file and directory taskes as needed...
  
  ; Disconnect the client and free extender resources
  fsClientDelete(client)
See Also:

fsClientDelete, fsDisconnect