docs(transfer): add how-to download files (#745)

also add information how to browse your app
files directory, which is hard to find.
I needed very long time to check where my files are.
This commit is contained in:
twaldecker 2016-10-27 12:30:02 +02:00 committed by Ibrahim Hadeed
parent 757d0961b9
commit 0317d4455f

View File

@ -148,8 +148,29 @@ export interface FileTransferError {
* })
* }
*
* // Cordova
* declare var cordova: any;
*
* download() {
* const fileTransfer = new Transfer();
* let url = 'http://www.example.com/file.pdf';
* fileTransfer.download(url, cordova.file.dataDirectory + 'file.pdf').then((entry) => {
* console.log('download complete: ' + entry.toURL());
* }, (error) => {
* // handle error
* });
* }
*
* ```
*
* Note: You will not see your documents using a file explorer on your device. Use adb:
*
* ```
* adb shell
* run-as com.your.app
* cd files
* ls
* ```
*/
@Plugin({
name: 'FileTransfer',