File Transfer
Used to instruct the system to retrieve a file for upload.
fromUrl
string file_transfer.fromUrl( string url )
Upload a file to the system from a URL. Returns an upload key to be used elsewhere to refer to the file.
Parameters
url
The URL where the file to be uploaded is located. Supports basic HTTP authentication. Eg:
http://user:pass@www.example.com/somedir/somefile.csv
Return Values
Returns a unique 32 character string, which is the key used to identify this uploaded file.
fromFtp
string file_transfer.fromFtp( array config, string path )
Instruct the system to retrieve a file from an FTP or SFTP site. Returns an upload key to be used elsewhere to refer to the file.
Parameters
config
Associative array detailing the connection configuration for the FTP or SFTP site.
Key | Type | Detail |
---|---|---|
protocol | string | 'ftp' or 'sftp', optional, defaults to 'ftp' |
host | string | required |
port | integer | optional, defaults to 21 for FTP and 22 for SFTP |
username | string | required |
password | string | required |
pasv | boolean | enables passive mode for FTP connections, optional, defaults to false |
path
The path where the file to be retrieved is located. Eg:
somedir/somefile.csv
Return Values
Returns a unique 32 character string, which is the key used to identify this uploaded file.
Service
file_transfer
Methods