mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
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:
parent
757d0961b9
commit
0317d4455f
@ -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({
|
@Plugin({
|
||||||
name: 'FileTransfer',
|
name: 'FileTransfer',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user