I want to be able to deploy my apk files to my locale home server and I am using the following code to write the file.
Everything works expect for when I am downloading the file on the android it is writing the file as a .zip.
How do I download the apk from a phone using ASP.NET MVC?
public ActionResult PullAPK()
{
string[] files = Directory.GetFiles(Server.MapPath("~/APK/"));
byte[] fileBytes = System.IO.File.ReadAllBytes(files[0]);
string fileName = Path.GetFileName(files[0]);
return File(fileBytes, "apk", fileName);
}
Adding the MIME to IIS still causes the file to be downloaded as an APK https://stackoverflow.com/a/7296865/5304320