files.download

files.download

This method offers alternative signatures:

files.download(fileToDownload, pathOnDevice, [options], [trustAllHosts])

Signature

files.download(fileToDownload, pathOnDevice, [options], [trustAllHosts])

Description

Downloads a file to the device's file system. Wraps the Apache Cordova "download()" FileTransfer method. Note that the signatures of these methods differ.

Return Type

Promise - The promise for the request.

Parameters

Parameter Name Type Default Description
fileToDownload string A Backend Services File ID.
pathOnDevice string An Apache Cordova FileSystem URL representing the local path on the device where the downloaded file will be saved. Maps to the "target" FileTransfer plugin parameter.
[options] object Additional request options. Maps to the "options" FileTransfer plugin parameter.
[options.headers] object A JSON object containing headers to send along with the request.
[trustAllHosts] boolean false Whether to accept all security certificates including self-signed certificates. Maps to the "trustAllHosts" FileTransfer plugin parameter.


files.download(fileToDownload, pathOnDevice, [options], [trustAllHosts], [success], [error])

Signature

files.download(fileToDownload, pathOnDevice, [options], [trustAllHosts], [success], [error])

Description

Downloads a file to the device's file system. Wraps the Apache Cordova "download()" FileTransfer method. Note that the signatures of these methods differ.

Parameters

Parameter Name Type Default Description
fileToDownload string A Backend Services File ID.
pathOnDevice string An Apache Cordova FileSystem URL representing the local path on the device where the downloaded file will be saved. Maps to the "target" FileTransfer plugin parameter.
[options] object Additional request options. Maps to the "options" FileTransfer plugin parameter.
[options.headers] object A JSON object containing headers to send along with the request.
[trustAllHosts] boolean false Whether to accept all security certificates including self-signed certificates. Maps to the "trustAllHosts" FileTransfer plugin parameter.
[success] function A success callback that is passed an Apache Cordova FileEntry object. Maps to the "successCallback" FileTransfer plugin parameter.
[error] function An error callback that is passed an Apache Cordova FileTransferError object. Maps to the "errorCallback" FileTransfer plugin parameter.


Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.