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_im age.php?image=' .$image_name.'" />
And this is created_image.p hp:
<?php
/* Created on Sep 3, 2008 - KM
* all this file does is display the gd created image
*/
if(empty($_GET) || !array_key_exis ts('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.
small script for displaying the image to the user.
This is what I use to display the image:
<img src="created_im age.php?image=' .$image_name.'" />
And this is created_image.p hp:
<?php
/* Created on Sep 3, 2008 - KM
* all this file does is display the gd created image
*/
if(empty($_GET) || !array_key_exis ts('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.
Comment