func X3.EN_FTP_DOWNLOAD(Char SERVER_IN, Integer PORT_IN, Shortint IS_SFTP_IN, Char KEY_IN, Char PUBKEY_IN, Char CERT_IN, Char CACERT_IN, Char CERT_PASS_IN, Char LOGIN_IN, Char PASS_IN, Char FILE_IN, Char DIRECTORY_IN) : Tinyint

Allows you to download a file from an FTP server

  • SERVER_IN Char Name or IP of the server to connect to
  • PORT_IN Integer Port number to connect to (or 0 for default port)
  • IS_SFTP_IN Shortint 1 if the server is an SFTP, 0 if it is an FTP
  • KEY_IN Char Url to key file if necessary or ""
  • PUBKEY_IN Char Url to public key file if necessary or ""
  • CERT_IN Char Url to certificate file if necessary or ""
  • CACERT_IN Char Url to authority certificate file if necessary or ""
  • CERT_PASS_IN Char Certificate password if necessary or ""
  • LOGIN_IN Char Server connection ID
  • PASS_IN Char Server connection password
  • FILE_IN Char Path on the server to the file to download
  • DIRECTORY_IN Char Local directory or volume where to download the file
Return Tinyint 1 if OK or 0 otherwise
Example

# Connection to the sftp server myftpserver.com on port 2222 with the user user1 and download of the cmd.txt file to the tmp folder
If func X3.EN_FTP_DOWNLOAD("myftpserver.com", 2222, 1, "", "","", "", "", "user1", "p@ss0ne", "/home/user1/reppub/cmd.txt", filpath("tmp","",""))
Infbox "OK"
Else
Infbox [V]GX3ERR
Endif