forceful download not working for browser on Android phone on wap site
<p>I have a wapsite where i am implementing forceful download.</p>

<p>The script is in PHP</p>

<p>It works great for all the other mobile browsers, but when I access the site using ANDROID phone, it downloads the actual php file.</p>

<p>following is my code snippet of file downloadFiles.php.</p>

<hr>

<p>$fileExt = "jpg";
$strOrgFileName = "abc.jpg";</p>

<p>switch($fileExt) 
{</p>

<p>case "jpeg":</p>

<p>case "jpg": $ctype="image/jpg"; break;</p>

<p>case "gif": $ctype="image/gif"; break;</p>

<p>case "png": $ctype="image/png"; break;</p>

<p>case "zip": $ctype="application/zip"; break;</p>

<p>default: $ctype="application/force-download";</p>

<p>}</p>

<p>header("Pragma: public");</p>

<p>header("Expires: 0");</p>

<p>header("Cache-Control: must-revalidate, post-check=0, pre-check=0");</p>

<p>header("Content-Type: $ctype");</p>

<p>header("Content-Description: File Transfer");</p>

<p>header("Content-Disposition: attachment; filename=\"".$strOrgFileName."\";" );</p>

<p>readfile($strOrgFileName);</p>

<hr>

<p>In Android system it downloads the php file.</p>

<p>ie. downloadFiles.php</p>

<p>Please help through this.</p>
