Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download file not working #311

Closed
AmedeoLeo opened this issue Oct 3, 2018 · 8 comments · Fixed by #1019
Closed

Download file not working #311

AmedeoLeo opened this issue Oct 3, 2018 · 8 comments · Fixed by #1019

Comments

@AmedeoLeo
Copy link

I am using the inappbrowser to download an .apk file, but the download does not start.
I've tested the HTML page by using several mobile browser and everything works.
Any feedbacks?

@klochko7
Copy link

klochko7 commented Nov 8, 2018

I have the same issue. When I am trying to download apk file from chrome, download does not start.

@janpio
Copy link
Member

janpio commented Nov 8, 2018

Please create a new Cordova project with a minimal setup to replicate the issue. Then put it on Github and post the link to it here. Thanks.

@opare
Copy link

opare commented Apr 12, 2019

I have the same issue too. Any news about that? Thanks.

@Macfa
Copy link

Macfa commented Mar 9, 2020

same issue here !

@lovepanda603
Copy link

same issue , Hope to be solved

@AiNings
Copy link

AiNings commented Aug 26, 2020

IOS cannot download online files, have you solved it?

@JensUweB
Copy link

@janpio How is it going with this? I'm currently facing the same problem. I could setup a minimal repo, if still needed.
This project is still maintained, right?

@JensUweB
Copy link

JensUweB commented Feb 24, 2021

I found out whats going on here. InAppBrowser uses the android web view by default. Android Web View does not handle downloads by default, because it cannot render or download files (except html, css & js of course), so you have to register a download listener and handle it yourself. If you don't handle it yourself and just register the listener, the web view will crash (and so will your app), if the user klicks a download link.

As workaround, you can try to modify the java code of the InAppBrowser yourself as described here.

Edit: Found another possible workaround, without messing around with native java code. Link to Stackoverflow. You can inject javascript into the browser, register with the injected script a custom click listener onto your anchor links and send the download url with over the message api back to your cordova context to download the file yourself. I'm working on that right now.

@breautek breautek added this to the 5.1.0 milestone Sep 15, 2023
saschal-j5int pushed a commit to saschal-j5int/cordova-plugin-inappbrowser that referenced this issue Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants