我正在尝试使用File Transfer plugin
从服务器下载文件
我的问题是进入成功功能的控制台:
下载完成:file:///storage/sdcard0/Android/data/statsh.appliMobile/files/PICTURE.png
但在进行研究后,我没有在智能手机(lenovo VIBE)中找到该文件
我以为我会在这个目录中找到它:PCLenovo P1ma40Phone storageAndroiddata
这是我的代码:
import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';
import { File } from '@ionic-native/file';
...
const fileTransfer: FileTransferObject = this.transfer.create();
const url = 'https://d30y9cdsu7xlg0.cloudfront.net/png/2048-200.png';
fileTransfer.download(url, this.file.externalDataDirectory + 'PICTURE.png').then((entry) => {
console.log('download complete: ' + entry.toURL());
}, (error) => {
});
}