Developer Resources
FileTransfer
Overview
FileTransfer allows the user to communicate with SFTP and FTP. Both the normal FTP and the secure SFTP protocols are supported.
Constructor
- FileTransfer()
Methods
- FileTransfer.download
- Downloads a file from an FTP or SFTP server
- FileTransfer.rename
- Renames a filename on a remote FTP or SFTP server
- FileTransfer.upload
- Uploads a file to an FTP or SFTP server
FileTransfer.download
- function FileTransfer.download(url : String, destination_filename : String) : Boolean
Arguments
- url
- The remote location to download
- destination_filename
- The filename to save, with full path name.
Returns
Returns true upon successful completion, otherwise false if an error occurred.
Description
Calling this method downloads a file from an FTP or an SFTP server onto the local computer. The url specified in the url parameter takes the following format: sftp://username:password@servername.domain.com/path/to/filename.ext -- If you wish to use the ftp protocol, change the protocol identifier before the first colon in the url string.
FileTransfer.rename
- function FileTransfer.rename(source_url : String, new_name : String) : Boolean
Arguments
- source_url
- The file to rename on the remote server
- new_name
- The new name the file should take
Returns
Returns true upon successful completion, otherwise false if an error occurred.
Description
Calling this method renames a file on a remote FTP or SFTP server The source url specified in source_url parameter takes the following format: sftp://username:password@servername.domain.com/path/to/filename.ext -- If you wish to use the ftp protocol, change the protocol identifier before the first colon in the url string. The filename specified in the new_name parameter indicates the new name that the file will take. It should be specified as a simple filename, without a qualifying path name.
FileTransfer.upload
- function FileTransfer.upload(source_filename : String, destination_url : String) : Boolean
Arguments
- source_filename
- The filename to upload
- destination_url
- The destination location of the upload
Returns
Returns true upon successful completion, otherwise false if an error occurred.
Description
Calling this method uploads a file from the local computer to an FTP or an SFTP server. The destination url specified in the destination_url parameter takes the following format: sftp://username:password@servername.domain.com/path/to/filename.ext -- If you wish to use the ftp protocol, change the protocol identifier before the first colon in the url string.

