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.

Remarks

Download a remote file into the repository

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
//Creating File Transfer Option
var fileTransferOptions = {
    RemoteHost : 'www.emakin.com',   //Url
    RemotePath : 'images/image.jpg', //Location
    Port : 80,                       //Port
    Protocol : 'HTTP'                //Protocol
};

//Downloading File
var file = $Files.Download("FileName", 'image/jpeg', fileTransferOptions);

See Also