aWebDeveloper aWebDeveloper - 2 months ago 16
Javascript Question

Download a file and show it in downloads app or in notification in a cordova app

How do i make a file appear in the downloads app or in notification. Whenever a user clicks on the download in the app i want the file to get downloaded and show up in the default downloads app.

I could use the file transfer option of Cordova but it doesn't show up in the downloads app.

Answer

You need to use cordova InAppBrowser(cordova-plugin-inappbrowser).

window.open('http://www.myurl.com/file.pdf', '_system');

This will open the link in a system app. Which in most cases solves the problem.