FTPConnect
FTP function.
The FTPConnect function makes a connection to the specified FTP server.
Usage
Establishes the connection with the FTP server where subsequent FTP actions have to be done.
Syntax
FTPConnect(<FTP_servername>,<username>,<encrypted_password> [,<FTP_portnumber>])
or
ret=FTPConnect(<FTP_servername>,<username>,<encrypted_password> [,<FTP_portnumber>])Parameters
<FTP_servername> : string, url or IP address of the FTP server.
<username> : string, user name of the FTP server. If the connection can be anonymous, the parameter <username> must be "Anonymous" and the next field <paswword> is left at blank.
<encrypted_password> : string, password for the specified user name. The string is encryped. To encrypt the password, use either the Insert/Encrypted string menu option in WinTask Editor window or use the FTPConnect wizard (in the Language window, press F4 if the Language window is not displayed, check Show wizard checkbox and double click FTPConnect in the list). If there is no password, <encrypted_password> is " ".
<FTP_portnumber> : integer, port number used by the FTP connection, optional parameter. The default value is 21 when this parameter is not specified.
Return value
Ret, numeric return code. The return code is 0 when the connection has been successfully established. The non zero possible error codes are listed in FTP functions error codes topic. During #FTPTimeout seconds, the function tries to establish the connection and after this timeout, the standard error management is used.
Remarks
Before invoking any FTP function, a FTPConnect has to be done.
Only one FTP connection can be established.
See also
Examples
FtpConnect("www.wintask.com","ftp","MX/WH05CZE3h") ' connection to the FTP server www.wintask.com (fake credentials)
FtpConnect("192.135.90.5","Anonymous"," ") ' connection to the anonymous FTP server specified by its IP address
FtpConnect("www.wintask.com","ftp","MX/WH05CZE3h",35) ' connection to the FTP server www.wintask.com using port 35