I m using ionic 5+ and using ionic file transfer plugin for downloading a pdf file but whenever i m downloading a file im facing 2 issues
-
When ever im building a project i need to manually remove the deprecated one to this
public class FileProvider extends androidx.core.content.FileProvider
-
After i changing this and ran the application im getting 401 error
below is my code
pdfUrl = 'https://www.cs.toronto.edu/~hinton/absps/NatureDeepReview.pdf';
constructor(private transfer: FileTransfer, private file: File) {}
download() {
const fileTransfer: FileTransferObject = this.transfer.create();
const url = this.pdfUrl;
fileTransfer.download(url, this.file.dataDirectory).then((entry) => {
console.log('download complete: ' + entry.toURL());
this.saveData = entry.toURL();
}, (error) => {
// handle error
console.log(error);
});
is there any alternative for this and if i want to use capacitor where can get a sample related file download
1 post - 1 participant