wwftp::FtpConnect

Connects to an FTP site and allows passing of a user name and password. Any FTPConnect calls should be balanced by a matching call to FTPClose. FTPClose is called automatically when the object goes out of scope.

o.ftpconnect(lcServer, lcUsername, lcPassword)

Return Value

numeric - 0 success anything else: WinInet Error Code

Parameters

cServer
The server to connect to. Example: ftp.west-wind.com or 127.0.0.1

Note: Do not specify a URL here. This parameter should not include a protocol or port! Do not use ftp://www.west-wind.com/somfile.txt.

lcUsername
Optional - username for authenticated connections to the server

lcPassword
Optional - password for authenticated connections to the server

Example

oFTP = CREATE("wwFTP")

oFTP.FTPConnect("ftp.west-wind.com","jdoe","hispassword")
oFTP.FTPGetFileEx("pkzip.exe","c:\temp\pkzip.exe")
oFTP.FTPClose()

See also:

Class wwFtp (deprecated)

© West Wind Technologies, 2024 • Updated: 09/06/11
Comment or report problem with topic