The FTP functions can be used for uploading or downloading files from a web server (Zorro 1.16 and above).
ftp_download(string url, string path, string username, string password)
Downloads a file from a FTP server.
ftp_upload(string url, string path, string username, string password)
Uploads a file to a FTP server.
ftp_getdate(string url, string username, string password)
Ascertains the timestamp and the file size of a file stored on a FTP server.
Stops the currently running FTP transfer.
Returns the total file size of the current/last file in bytes.
Returns the amount of sent data of the current/last file in bytes.
Returns the timestamp of the current/last file, after ftp_getdate() was executed successfully.
Returns the status of a currently running or the last FTP transfer:
-1 if the last FTP transfer was stopped because of an error
0 if the FTP transfer is still running
1 if the last FTP transfer was successful
ftp_log (var mode)
Enables/disables the logging of FTP transfers. The logfile is named "ftp_log.txt".
url - URL of the file to be downloaded, or destination URL for a file upload (e.g.: "ftp://www.testhoster.com/downloads/test.txt").
path - local path + filename (e.g.: "testdir/test.txt")
username - FTP username
password - FTP password
mode - 1 to enable, 0 to disable FTP logging
- The functions ftp_download(), ftp_upload(), ftp_getdate() and ftp_debug() return 0 if an error occured or nonzero otherwise.
- After calling ftp_download(), ftp_upload() or ftp_getdate() you have to wait until the value of ftp_status() is nonzero.
- Only one FTP transfer can be run at the same time.
//Downloads the file "myfile.txt" and saves it in the Data folder
while(!ftp_status()) //as long as the download is running
if (ftp_status() == 1)
http functions, file functions