1

I'm developing a mobile app using Ionic 3. I use InAppBrowser native plugin to show an external website using his.inAppBrowser.create(url, '_blank', this.options); method in Ionic 3.

The external website displays dashboard and other web design. In some pages dashboard has download pdf/xl option, When I click the download buttons, it works fine in all browsers.

But when I call that external website from InAppBrowser in the Ionic 3 Mobile app, the download links in that page are not functional.

How can I download files from website using ionic 3 inappbrowser? Please help me anybody

Web dashboard has developed web team using Spring boot, java. One of the functionality of this website is to generate form data to pdf/xl and donwload as file when it is needed.

I have a two buttons for pdf and xl to download options to download. When you click a file to download, Server side code will create file from the Server and attached it with HTTP Response.

I have been trying this past two days but there is no LUCK :-(

Tried below links,

Phonegap/Cordova InAppbrowser File Download issue

But not getting any solution

Below is my ionic 3 code

   let target = "_blank";
   this.inAppBrowser.create(url, target, this.options);
   this.inAppBrowser.addEventListener('loadstart', function (event) {
   console.log("eventeventevent -- ", event);
   });

Please help me anybody regarding this

1 Answer 1

0

I faced the same issue few days back when I noticed that the PDF files could not be downloaded through "InAppBrowser".

So, what I did was I changed the target to "_system". When you do that your PDF File will be opened in the app through which you normally open your PDF Files (You must have set it in your preferences) or it would give you a prompt like "Open file with ... ".

2
  • But i need to display inappbrowser in '_self', I dont want to open device browser. Sep 26, 2018 at 5:19
  • @MallikarjunHampannavar did you find any solution? Dec 3, 2018 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.