diff --git a/src/plugins/filetransfer.ts b/src/plugins/filetransfer.ts index 73991d117..334d67095 100644 --- a/src/plugins/filetransfer.ts +++ b/src/plugins/filetransfer.ts @@ -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',