- GETTING STARTED
- Server connection
- File Transfer
- Directory operations
- File operations
- Script output
Connect to an FTP server.
- server: DNS name or IP address of the FTP server.
- user (optional): user name for the login.
- password (optional): login password.
- Use SETPROTOCOL before calling OPENHOST if you want to use secure FTP.
- If no user name and password are supplied ScriptFTP will try to login anonymously.
- If you do not want your FTP password to show up in clear text you can encrypt the entire script file. See Encrypting script files.
OPENHOST will return "OK" as soon as the login has been successful and the connection is established.
If the operation fails it will return an error code. You may check the return value in order to try again. See Error handling or the last example on this page.
# Connect to ftp.funet.fi anonymously, download README
# and then upload it to ftp.myhost.com
# The file will be downloaded to the Windows temp directory
# Delete the downloaded README file
# This is a label marking a specific location in the script.
# Connect to FTP server
# Check if OPENHOST has failed
PRINT("Error. Cannot connect to FTP server.")
# Wait 1 second
# Once ScriptFTP reaches this point
# it is connected to the FTP server
# Download notes.doc
# Close the connection