Download Apk

The most important to download apk or android application file download is to write code for that otherwise .apk file is not open by server and may be generate error message. here i am write some code that help to you to download .apk file

Create download.php file
<?php
$file_path="apk/BookMyOrder.apk";
$file_name="BookMyOrder.apk";
header('Content-Type: application/vnd.android.package-archive');
header("Content-length: " . filesize($file_path));
header('Content-Disposition: attachment; filename="' . $file_name . '"');
ob_end_flush();
readfile($file_path);
return true;
?>

Here BookMyOrder.apk is android application that uploaded in apk folder.

Now create another file from where your file is downloaded.

For E.g. create index.php file and add following code
<a href="download.php" target="_Blank" > Download BookMyOrder Apk </a>