Using ftp

Added by iNTERFACEWARE

ftp commands to list, download, upload and rename files, the commands for ftps and sftp are similar

Source Code
   -- cache the connection parameters - substitute your ftp server details
   local FtpConn = net.ftp.init{server='example', username='user', password='password'}
   
   -- list directories
   FtpConn:list{remote_path=''}          -- users home directory
   FtpConn:list{remote_path='/'}         -- ftp root directory
   FtpConn:list{remote_path='/fox_out/'} -- user specified data directory
   
   -- get (download) files 
   
   -- get a text file (opens/closes an ASCII connection)
   FtpConn:get{remote_path='/fox_out/test.png',local_path='temp/test.txt'}   
   -- get a binary (picture) file (opens/closes a binary connection)
   FtpConn:get{remote_path='/fox_out/test.png',local_path='temp/test.png'}

   -- put (upload) files
   
   -- put a text file (opens/closes an ASCII connection)
   FtpConn:put{remote_path='/fox_in/test.png',local_path='temp/test.txt'}
   
   -- put a binary (picture) file (opens/closes a binary connection)
   FtpConn:put{remote_path='/fox_in/test.png',local_path='temp/test.png'}   
   
   -- rename a file
   FtpConn:rename{remote_path='/fox_out/test.txt', new_remote_path='/fox_processed/test_old.txt'}
Description
ftp commands to list, download, upload and rename files, the commands for ftps and sftp are similar