This command opens a FTP session so that remote file operations may be performed.
The FTP session number to be opened. Up to 10 sessions may be open at any time. The session number identifies which FTP session is being accessed. The session number ranges from 1 to 10.
This string contains the url or IP address of the FTP server
This is the FTP port number. It is almost always 21.
This is the login user name.
This is the login password.
This is an optional parameter which specifies the timeout for all FTP commands. If not specified it defaults to 10 seconds. Timeout is in milliseconds.
FtpOpen 1, "myftp.com", 21, "myname", "mypass"
err$ = FtpGetError$(1)
if err$ <> "" then Print "Error - "; err$
if FtpGetState(1) = 1 then
Print "Ftp Open"
Print "Ftp Open Failed"
After a FtpOpen it is important to check if the open succeeded. All internet connections are subject to interruption at any time so check the FtpGetError$(n) after each FTP command you execute.