Skip to content Skip to sidebar Skip to footer

Download Apk File Using Php

I am trying to download an android APK file using php in my PC browser using Chrome. My app is located in a particular path in the server. If I manually FTP the file from server a

Solution 1:

I managed to make it work by adding ob_end_flush()

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;

Post a Comment for "Download Apk File Using Php"