I create an image with PHP and output it in the following way
$im = imagecreatetruecolor($w,$h);
...
header('Content-type: image/png');
header('Cache-Control: no-store, no-cache');
imagepng($im);
imagedestroy($im);
If I right click on the image and select 'Save image as...' in Chrome browser I get a "Failed - Network error". It does not save the image to a file. If I do the same with FireFox, Safari, or IE it works fine. I have tried to add the content disposition header like so:
header('Content-disposition: inline; filename=image.png');
This did not fix it. Chrome also shows the filename to be saved as a .php file, the name of the generating PHP file, not a .png extension as FireFox for example does. Anybody knows what I am doing wrong?