Tuesday, 5 August 2014

code to download .apk file from website in asp.net

  Follow Me To get Health Tip and bodybuilding Tip
instagram:sayyedtanveer1410



It is often a common requirement in a web application to have the ability to download some sort of file to the client's computer. Nowadays android application(.apk) are also be download from web application
so we need to know the mime type of android apk.
mimeType="application/vnd.android.package-archive"

Download Code:

 string FilePath = Server.MapPath("~/Files/Android.apk");

 Response.AppendHeader("content-disposition", "attachment; filename=" + Path.GetFileName(FilePath));

 Response.ContentType = "application/vnd.android.package-archive";                     

 Response.WriteFile(FilePath);


Note :Once you download .apk file from web application  and it can't be opened from the Browser please check it's mime type

No comments:

Post a Comment