Click or drag to resize

CFtp.ConnectRemote Method

X#
Connect an application to a remote FTP server.

Namespace:  VO
Assembly:  VOInternetClasses (in VOInternetClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD ConnectRemote(
	cIP,
	cID,
	cPw,
	lBypass
) AS USUAL CLIPPER
Request Example View Source

Parameters

cIP (Optional)
Type: Usual
String containing the host name of an Internet server. Alternately, the string can contain the IP number of the site in ASCII dotted-decimal format (for example, 11.22.3.45).
cID (Optional)
Type: Usual
String that contains the name of the user to log on. If this parameter is NULL, the function uses the appropriate default ('anonymous'). For the FTP protocol, the default is anonymous.
cPw (Optional)
Type: Usual
User's password as a string. For anonymous login users, the user's e-mail name can be used as password.
lBypass (Optional)
Type: Usual
** missing parameter documentation **

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
This method establishes a connection to a remote FTP server.
Examples
The following example creates a list of all files and directories of the X# download section at ftp.cai.com:
X#
 1FUNC ListVOFiles()
 2LOCAL oFTP AS CFtp
 3LOCAL lRet AS LOGIC
 4LOCAL aRet AS ARRAY
 5LOCAL i    AS INT
 6oFTP := CFtp{"VO Sample FTP Agent"}
 7IF oFTP:ConnectRemote("ftp.cai.com", ;
 8                     "anonymous",   ;
 9                     "Darth.Vader@starwars.com")
10oFTP:SetCurDir("/pub/vo")
11? "Contents of Directory " + oFTP:GetCurDir()
12aRet := oFTP:Directory("*.*")
13FOR i := 1 UPTO ALen(aRet)
14?  aRet[i, F_NAME]
15?? ", Size: " + NTrim(aRet[i, F_SIZE])
16?? ", Date/Time: " + DToC(aRet[i, F_DATE]) + ;
17"/" + aRet[i, F_TIME]
18?? ", Attribute(s): ", aRet[i, F_ATTR]
19NEXT
20ENDIF
21oFTP:CloseRemote()
X#
1RETURN lRet
See Also