I am forcing the download of an image through my website.
Forced download works fine on Apache/Windows development machine.
However it pushes junk characters to the screen when live on my linux web server.
e.g. �����JFIF��H�H����6Exif��MM�*����
- Firefox - junk
- Chrome - junk
Internet Explorer 7 - displays the image in the page
$fileName = basename($filePath); $fileSize = filesize($filePath); // Output headers. header("Cache-Control: private"); header("Content-Type: Image/jpeg"); header("Content-Length: ".$fileSize); header("Content-Disposition: attachment; filename=".$fileName); // Output file. readfile ($filePath); exit();
What differences might there be on my live server that would cause it to break?