Transfer data to or from the FTP server and send progress events.
First available in version 3.0 build 2039.
No output parameters.
This method can only be called asynchronously.
FTP.transfer is an asynchronous command, meaning that the plugin will automatically process the command in the background without halting your application. Once the transfer is complete, you are responsible for calling FTP.close and/or FTP.disconnect to close the files/connection.
There are 2 ways of making use of FTP.transfer to perform a file transfer.
- When progress information is required, you need to first call FTP.setNotify to register a variable to be notified, and then you call FTP.transfer to perform the operation. Your callback function will be called when the transfer is complete.
- When no progress information is required, you can make a "blind" transfer. This is done by simply calling FTP.transfer without first registering for notifications. Your callback function will be called when the transfer is complete.
The registered progress variable will be updated as blocks (or chunks) of data get transferred. (The size of the blocks is determined by FTP.bufferSize.)
To abort a transfer in progress, you call FTP.close. This will result in the registered progress variable being set to "-1". Also, FTP.transfer will fail with the error code set to "24" (Transfer aborted).