I am unable to download a apk files using asp.net c#. I attached the code for your reference. Its working fine in Mozilla firefox of system, but it shows download
incomplete in all android mobiles. Kindly give me the solution for this problem.
Default.aspx.cs
-----------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ClearContent();
Response.Clear();
Response.ContentType = "application/msi";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + WebConfigurationManager.AppSettings["filename"].ToString());
Response.TransmitFile(Server.MapPath("~/apk/") + WebConfigurationManager.AppSettings["filename"].ToString());
Response.End();
}
}
Web.config
-------------------
Abhishek JainPosted Aug 22, 2013, 8:02 AM
Add a hyperlink on your page and provide the path of the APK file in navigate URL
Sample Code: