Hugh McCurdy
asked on
image/jpg in HTTP response header not working in Internet Explorer
I'm having trouble with this PHP script in Internet Explorer/Win7. It works fine in Firefox/Win7, Chrome/Win7, Firefox/Linux and Chrome/Linux.
<?php
header('Content-type: image/jpg');
header('Content-Dispositio n: inline');
readfile('images/tree-red. jpg');
?>
You can see a working example at http://hugh.tekcities.com/hugh/foo.php
If I use image/png and use a png file or image/gif and use a gif file, it works in all tested browsers including Internet Explorer. It is only the jpg's that have problems.
What it does is try to download the file instead of display the image. Not only that, but it thinks the filename is foo.php (or whatever the name of the script happens to be). But then it downloads the image (not the php file).
<?php
header('Content-type: image/jpg');
header('Content-Dispositio
readfile('images/tree-red.
?>
You can see a working example at http://hugh.tekcities.com/hugh/foo.php
If I use image/png and use a png file or image/gif and use a gif file, it works in all tested browsers including Internet Explorer. It is only the jpg's that have problems.
What it does is try to download the file instead of display the image. Not only that, but it thinks the filename is foo.php (or whatever the name of the script happens to be). But then it downloads the image (not the php file).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER