0

I'm working on an Angular Ionic 7 App with capacitor 5. At one page of my app is a list of different files (pdf, txt,csv). The user can select a file and it should download to the device. I tryed to create a Object Url and open it with window.open(fileURL), but nothing happens, also no error. I tryed the library @capacitor/filesystem with downloadFile() Api. The result contins a blob but I'm not able to store it on the device. Does anybody know how to do this?

 Filesystem.downloadFile({ path: Directory.Data, url: url, directory: Directory.Data }).then((res) => {
    console.log('download finished');
  });
keschra
  • 289
  • 1
  • 3
  • 17
  • Does this answer your question? [How to open a PDF File from Blob with Ionic FileOpener and Capacitor](https://stackoverflow.com/questions/58071567/how-to-open-a-pdf-file-from-blob-with-ionic-fileopener-and-capacitor) – Raphaël Balet Sep 01 '23 at 07:58
  • No, it is using fileOpener, which is not working for android 11 or later https://github.com/pwlin/cordova-plugin-file-opener2 – keschra Sep 01 '23 at 10:57

0 Answers0