The FTP plugin is used to transfer files to and from FTP servers using the FTP protocol.
Using the FTP plugin you will be able to:
- transfer text or binary data
- support multiple simultaneous sessions
- talk to FTP servers over non-standard ports
- use passive or non-passive semantics
- get the size of a file before you download it
- find out how many bytes have been downloaded so far
- report on upload/download progress during file transfers
- specify the local file destination for download
- set the user agent to impersonate different FTP applications
- detect timeouts in transfers and/or abort a transfer in progress
- provide FTP proxy information
- get FTP directory listings as plain text or XML
- create and remove files and directories on the server
- navigate around the FTP server file system
The FTP plugin exposes a number of commands for setting properties of the FTP session and five simple commands that allow you to control the FTP session (FTP.connect, FTP.open, FTP.transfer, FTP.close and FTP.disconnect).
After setting the session properties, you call FTP.connect to make a connection to the server. The FTP.open command is then called to open the file to be uploaded/downloaded. Once the file is open, the FTP.transfer command is called do the actual transfer (and optionally track the progress). You can call FTP.close any time during a transfer to stop it and FTP.disconnect is called to terminate the connection with the server.