ftpDownload

ftpDownload ( string server , string login , string password , string pathOnServer , string pathOnDisk , int _port , string _protocol ) : void

Download on your computer a file present on your server by FTP.

Example


ftpDownload("87.158.246.12","admin","sd44f88t4h","/var/www/download/myFile.csv",path("tmp")+"csv.csv")


Tips

If you have an error, try to check the pathOnDisk exist, to do that, in debug mode, evaluate the pathDisk value and copy-paste it in the Windows Search (press Win and do Ctrl+V) and see if the file is displayed.

Parameters

server

host

login

login of the server

password

password of the server

pathOnServer

file path on the server. Use / to separate directories.

pathOnDisk

file path on your disk. Pay attention, use \ for Windows and / for Linux and Mac

_port (optional)

default:21. For SFTP it is generally 22.

_protocol (optional)

default:"ftp"
Possible values:
• "ftp" : Normal FTP protocol
• "sftp" : Transfer over SSH
• "ftps" : Secure FTP or FTP over TLS/SSL (quite rare)