OpenFTP()
Syntax
Result = OpenFTP(#Ftp, ServerName$, User$, Password$ [, Passive [, Port]])Description
Tries to open a connection on the specified FTP server.
Parameters
#Ftp The number to identify the new connection. #PB_Any can be used to auto-generate this number. ServerName$ The URL or address of the server to connect to. User$ The user name to authenticate on the server. Password$ The password to authenticate on the server. Passive (optional) Enables or disables passive mode for the connection (valid values are #True or #False). If this parameter is not specified, passive mode will be used. Port (optional) The port to use for the connection. The default is port 21.
Return value
Returns nonzero if the connection was established correctly and zero if there was an error. If #PB_Any is used as the #Ftp parameter then the generated number for the connection is returned on success.
Remarks
InitNetwork() has to be called before using this command, as all the FTP commands are based on the network library.
Example
InitNetwork() If OpenFTP(0, "ftp.free.fr", "anonymous", "") Debug "Successfully connected" Else Debug "Can't connect to ftp.free.fr" EndIf
See Also
CloseFTP(), SetFTPDirectory(), ReceiveFTPFile(), SendFTPFile(), ExamineFTPDirectory()
Supported OS
All