Skip to content

Download

Downloads a file from a remote environment, stores it in the repository, and returns the created FileInfo.

1
myFiles.Download(name: string, mimeType: string, options: FileTransferOptions):FileInfo

Parameters

string name
    The name to save the file as.

string mimeType
    The MIME type of the file.

FileTransferOptions options
    Download options. See FileTransferOptions for more details.

Returns

The created FileInfo.

Examples

Download a file over HTTPS

1
2
3
4
5
var file = $Files.Download('logo.png', 'image/png', {
    RemoteHost : 'www.example.com',
    RemotePath : 'images/logo.png',
    Protocol : 'HTTPS'
});

Download a file from an FTP server

1
2
3
4
5
6
var file = $Files.Download('orders.csv', 'text/csv', {
    RemoteHost : 'ftp.example.com',
    RemotePath : 'outgoing/orders.csv',
    UserName : 'transfer',
    Password : 'secret'
});

See Also