Add the ability to download files in a webView from a page that is hosted remotely. More specifically, add the ability to download an apk and install it as you can in the Android browser.
Step 1: create an app with the code below
Step 2: create an a file named index.html on your server with the html below
Step 3: put Test3.apk in the same folder as index.html
Step 4: change the url in the app to point to the index.html that you made
Step 5: click on the link and notice that it does not download the file
Step 6: open the same url in the Android browser and notice that you are able to download the file when you click on the link and you are also able to install the akp.
var win = Titanium.UI.createWindow();
var webview = Titanium.UI.createWebView({
url: 'http://localhost/~jalter/test/'
});
win.add(webview);
win.open();
<body>
<form id="form1" runat="server">
<div>
<a href="Test3.apk">Download android</a> <br />
</div>
</form>
</body>
Associated Helpdesk Ticket
http://appc.me/c/APP-623653
PR Submitted: https://github.com/appcelerator/titanium_mobile/pull/3200
We will not be addressing this issue.
Closing ticket as "Won't Fix".
Hi All, Is there any solution to download the file/document in webview ?
HI All, I was unable to resolve this issue. Is there any solution to download the file/document in webview ?