Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4860] Android: download files in a WebView

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2014-03-04T22:53:40.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsAndroid
Labelsexalture
ReporterJon Alter
AssigneeVishal Duggal
Created2011-08-01T11:44:41.000+0000
Updated2017-12-26T09:17:04.000+0000

Description

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

Attachments

FileDateSize
Test3.apk2011-08-01T11:44:41.000+00002257383

Comments

  1. Anirudh Nagesh 2012-10-03

    PR Submitted: https://github.com/appcelerator/titanium_mobile/pull/3200
  2. Ingo Muschenetz 2014-03-04

    We will not be addressing this issue.
  3. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".
  4. chanakya 2017-12-19

    Hi All, Is there any solution to download the file/document in webview ?
  5. chanakya 2017-12-26

    HI All, I was unable to resolve this issue. Is there any solution to download the file/document in webview ?

JSON Source