2

When looking at downloading a file I always end up at the docs for chrome.downloads API, but this is only available for extensions and not packaged apps.

So how can I download a file in a Chrome packaged app?

Pier
  • 10,298
  • 17
  • 67
  • 113

1 Answers1

2

See the documentation for Referencing external resources.

In short, the recommendation is to save downloaded resources (e.g. images) as blob: URLs that you can store in any of the Storage APIs.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • 1
    For anyone trying to figure this out check this other answer: https://stackoverflow.com/questions/34531428/chrome-apps-how-to-save-blob-content-to-filesystem-in-the-background – Pier Aug 26 '17 at 18:47
  • I made this repo with an example app: https://github.com/PierBover/chrome-os-app-download-example – Pier Aug 26 '17 at 19:56