By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,748 Members | 2,043 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,748 IT Pros & Developers. It's quick & easy.

GD and IE7 issue...

P: n/a
Hello, I currently have a script that creates a image and then another
small script for displaying the image to the user.

This is what I use to display the image:

<img src="created_image.php?image='.$image_name.'" />

And this is created_image.php:

<?php
/* Created on Sep 3, 2008 - KM
* all this file does is display the gd created image
*/

if(empty($_GET) || !array_key_exists('image', $_GET)) {
exit();
}

$tmp_dir = "/tmp/";
header("Content-type: image/jpg");
$image = $_GET['image'];
//check for file first, just in case
$file = $tmp_dir.$image;
if(file_exists($file)) {
readfile($file);
unlink($file);
exit();
} else {
die("ERROR: Image file $file not found!");
}
?>

Now, the image is displayed correctly, no problems. The issue is that
users are unable to right click and save as with the image because IE7
says "The system cannot find the file specified." I thought maybe it
was the unlink, but even removing that doesn't make a difference. Any
ideas? Thanks.
Oct 13 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Oct 14, 4:20 am, Keith Miller <kee...@gmail.comwrote:
<snip>
header("Content-type: image/jpg");
<snip>
Now, the image is displayed correctly, no problems. The issue is that
users are unable to right click and save as with the image because IE7
says "The system cannot find the file specified." I thought maybe it
was the unlink, but even removing that doesn't make a difference. Any
ideas? Thanks.
Try setting the cache headers too.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
Oct 14 '08 #2

P: n/a
Oddly enough turning off caching worked. I guess IE7 was not saving
the local copy correctly. Now the issue is that it wants to save it as
a bmp instead of a jpeg. Weird.
On Oct 13, 7:20*pm, "R. Rajesh Jeba Anbiah"
<ng4rrjanb...@rediffmail.comwrote:
On Oct 14, 4:20 am, Keith Miller <kee...@gmail.comwrote:
* *<snip>
header("Content-type: image/jpg");
* *<snip>
Now, the image is displayed correctly, no problems. The issue is that
users are unable to right click and save as with the image because IE7
says "The system cannot find the file specified." I thought maybe it
was the unlink, but even removing that doesn't make a difference. Any
ideas? Thanks.

* * Try setting the cache headers too.

--
* <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com * *Blog:http://rajeshanbiah.blogspot.com/
Oct 14 '08 #3

P: n/a
Keith Miller escribió:
Oddly enough turning off caching worked. I guess IE7 was not saving
the local copy correctly. Now the issue is that it wants to save it as
a bmp instead of a jpeg. Weird.
That's a known bug of IE 6. You must remove manually the temporary
Internet files.

So that bug also remains in version 7? Why aren't I surprised?

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Oct 15 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.