Page 1 of 1

In App Browser download links

Posted: Mon Mar 24, 2014 5:10 am
by Austin Troth

I have a couple of links in my app that link to the in app browser. These websites have PDFs that we need to download. However, when I click the links to download them, nothing happens. How can I get the in app browser to work with these downloads? I like in the in app browser because it has the "done" button allowing me to go back to the app. thanks!


In App Browser download links

Posted: Mon Mar 24, 2014 8:46 am
by Maryna Brodina

Hello!

There is no way to do that. inAppBrowser can't download files. But you can download PDF in your app (here is more information http://cordova.apache.org/docs/en/3.0...).
Open sites in inAppBrowser and track navigation. If it goest to PDF file, download itprevar ref = window.open("http://your.site.com/", '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) {
if (event.url.indexOf(".pdf") === event.url.length-4) {
//download file event.url
}
});/pre