4D v13.2

FTP_Login

Home

 
4D v13.2
FTP_Login

FTP_Login 


 

FTP_Login ( hostName ; userName ; password ; ftp_ID ; welcomeText ) -> Function result 
Parameter Type   Description
hostName  String in Host name or IP address
userName  String in User name
password  String in Password
ftp_ID  Longint in Reference to this new FTP session
welcomeText  Text in FTP Welcome text
Function result  Integer in Error Code

The FTP_Login command establishes a connection with the FTP server at hostName and logs onto the system using the supplied userName and Password.

hostName is the host name or IP address of the remote system.

userName is the name of a user account recognized by the FTP server. Many FTP servers support guest access via an "anonymous" username. If you are logging in anonymously, it is customary to supply your e-mail address as the password.

password is the password for userName on the system.

ftp_ID is the long integer value obtained for the newly opened session. This value will be used in subsequent FTP commands. This parameter must be passed a 4D variable or field in order to accept the returned results.

welcomeText is an optional parameter which contains the text returned when the user logs into the system. Many FTP sites have a Welcome message displayed at the time of login. If specified, this parameter must be passed a 4D variable or field in order to accept the returned results.

Example  

 $OK:=False
 Case of
    :(FTP_Login("ftp.4d.com";"anonymous";"dbody@aol.com";vFTP_ID;vFTP_Msg)#0)
    :(FTP_Progress(-1;-1;"Progress window";"Getting requested file…";"*")#0)
    :(FTP_Send(vFTP_ID;"My Hard Drive:Documents ƒ:July Sales Report";"/pub/reports";1)#0)
    :(FTP_Logout(vFTP_ID)#0)
    Else
       $OK:=True `all commands executed without error
 End case

Note: For more information about this particular use of the Case of structure, please refer to Appendix A, Programming Tips.

 
PROPERTIES 

Product: 4D
Theme: IC File Transfer
Number: 88945

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Internet Commands 6.5

 
SEE ALSO 

FTP_Logout