Reputation: 11
I am trying to download pdf file in ionic 5 application, which is stored in firebase storage i tried using filetransfer but file not downloading in my device it gives entry url this
file:///data/user/0/io.ionic.starter/files/test.pdf
Here the Download function
download(downloadUrl: string) {
console.log(downloadUrl);
this.fileTransfer.download(downloadUrl,this.file.dataDirectory +'test.pdf').then((entry) => {
console.log('download complete: ' + entry.toURL());
}, (error) => {
});
}
Upvotes: 0
Views: 469
Reputation: 4782
You need to add
android:requestLegacyExternalStorage="true"
inside AndroidMenifest.xml > application tag like below screenshot. It's required to add in the android 11 version.
Upvotes: 1