I followed the question with the same name (File import not initializing in constructor ionic native. The cordova file plugin and javascript file interface is conflicting .?), but the issue is still present
Using the solution suggested, the file object is always undefined
import { File as cordova_file } from '@awesome-cordova-plugins/file';
....
export class HomePage {
private file: typeof cordova_file
downloadFileTransfer() {
const fileTransfer: FileTransferObject = this.transfer.create();
const url = 'mysampleUrl';
fileTransfer.download(url, this.file.externalApplicationStorageDirectory).then((entry) => {
console.log('download complete: ' + entry.toURL());
}, (error) => {
// handle error
});
}
the file object is always undefined. please help.
Thanks