Force downloading an image via php script works but the image only opens in paint not photoshop
<p>Here is my php script which executes the download:</p>

<pre><code>$link = 'www.example.com';
$url = urlencode($link);

$image = "http://chart.googleapis.com/chart?chs=75x75&amp;cht=qr&amp;chl=$url&amp;choe=UTF-8&amp;chld=L|0";
$filename = file_get_contents("$image");


header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

header("Content-Disposition: attachment; filename='qr code';");

header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));

echo $filename;
</code></pre>

<p>This downloads a file but it only opens in paint not photoshop. As a hint there doesn't appear to be a file type associated with the file (e.g. png or jpg).</p>

<p>I need all the headers above so this works in all browsers.</p>

<p>Thanks.</p>
