3

Boss is requesting that we make our new email web app into a Progressive Web App. We are finding that there is no way to save local files from PWAs but he has asked that we keep looking for a way.

Can somebody please confirm that it is impossible to save files to the local filesystem when the webpage is running as a PWA?

Obviously for an email app you need to be able to download the files from your email, so without access to local filesystem storage there's no chance of downloading files right?

This would need to work across devices (iOS + Android)

Edit: This is not a duplicate of the question: "how to save a file in javascript"

That solution does not work and it seems to be documented that it doesn't work in PWAs on iOS: https://github.com/eligrey/FileSaver.js/issues/479

Anyway you guys have indirectly answered my question, it seems this is not supported and there is no workaround.

E_net4
  • 27,810
  • 13
  • 101
  • 139
user6567423
  • 353
  • 4
  • 9
  • Possible duplicate of [JavaScript: Create and save file](https://stackoverflow.com/questions/13405129/javascript-create-and-save-file) – Iłya Bursov Feb 11 '19 at 21:14
  • Not sure what "download the files from your email" means. Do you mean the user should be able to download email attachments? I don't see why you can't just handle the file download like any other file download. – JJJ Feb 11 '19 at 21:17
  • @IłyaBursov Not really a duplicate because that is the general question for javascript, if you actually look at the second answer which links the github for FileSaver.js you will see an issue on that github: https://github.com/eligrey/FileSaver.js/issues/479 – user6567423 Feb 11 '19 at 21:25
  • @JJJ It doesn't work when you add the app to the homescreen as a PWA on iOS, I was finally able to find other with same issue and the consensus is there's no workaround – user6567423 Feb 11 '19 at 21:27

1 Answers1

2

The answer is: no, there is no way to download files to the local filesystem in a Progressive Web App on iOS -- they do not support it.

Quote from here: https://github.com/eligrey/FileSaver.js/issues/479

This issue is based on the general iOS WebKit download attribute issue. The download attribute in iOS is not working, therefore the browser does not recognize the generated ObjectUrl as download and ignores the provided filename.

This issue cannot be resolved by WebKit itself, because it involves iOS proprietary code, which is the reason why all browsers on iOS are affected. I personally triggered an Apple Care incident assisted by the Browser Compliance Center of my employer and got a feedback from Apple.

This incident was classified as high priority and will be fixed for future releases. It will not be available in iOS version 12.1 or any prior version.

user6567423
  • 353
  • 4
  • 9