I have a link. When users click on that link it will update the count on database and the application will gets installed.
<a style="text-decoration: none" mimeType="application/vnd.android.package-archive" href="http://way2enjoy.com/touch/w2et/appdownload.php?file=http://way2enjoy.com/android/Way2Enjoy.apk?32" target="_new">Download Android <img src="http://www.way2enjoy.com/touch/w2et/android32.png" />app</a>
I have tried this file by directly pointing to android file and it got install without any issue but when i am going through this link it seems to be working and in pc and android file is getting downloaded but when i try to install file in android i get parsing error.
Here is my appdownload.php code
$c=explode("?",$_SERVER[ 'REQUEST_URI' ]); $city=end($c);
$c=explode("?file=",$_SERVER[ 'REQUEST_URI' ]); $city1=end($c);
$content = file_get_contents($city1);
header("Content-Type: application/vnd.android.package-archive");
header("Content-Disposition: attachment; filename=Way2Enjoy.apk");
mysql_query("update table SET count=count+1 where id='$city'");
echo $content;
mysql count
increases without any isssue and file is also getting downloaded but that file is not getting installed in android.
Any idea?