I am trying to create a system where a user can upload and image and a flash page will dynamically show that file. Everything is working fine, exept for the IE cache thing - netscape, firefox - no problem.
I have tried a million and one things and this seems the most promising. When I try to put the session_start(); in my code I get errors - without it... cache problems.
here is my php:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
session_start();
header("Cache-Control: private");
if(isset( $Submit ))
{
$var = md5(time());
$picture_name = "image.jpeg?var=".$var;
switch($FILES['imagefile']['type']) {
case 'image/jpeg':
case 'image/pjpeg':
$orig = imagecreatefromjpeg($FILES['imagefile']['tmp_name']);
break;
case 'image/png':
$orig = imagecreatefrompng($FILES['imagefile']['tmp_name']);
break;
case 'image/gif':
$orig = imagecreatefromgif($FILES['imagefile']['tmp_name']);
break;
default:
$error = 'Unknown File Format or MIME Type';
$show = 'error';
echo "Wrong Filetype E1";
}
if($orig) {
$orig_x = imagesx($orig);
$orig_y = imagesy($orig);
$image_x = 200;
$image_y = round(($orig_y * $image_x) / $orig_x);
$image = imagecreatetruecolor($image_x, $image_y);
imagecopyresampled($image, $orig, 0, 0, 0, 0, $image_x, $image_y, $orig_x, $orig_y);
imagejpeg($image, "images/". 'image.jpeg');
echo "upload done!!!";
}
else {
if(!$error)
$error = 'Error reading uploaded image';
$show = 'error';
echo "Wrong Filetype E2";
}
}
?>
and the errors:
Warning: session_start(): open(/tmp/php-ses/sess_f96b0feb611f10312a4ad92fba3bdb1f, O_RDWR) failed: No such file or directory (2) in /nfs/cust/7/04/28/582407/web/imagesize.php on line 6
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /nfs/cust/7/04/28/582407/web/imagesize.php:6) in /nfs/cust/7/04/28/582407/web/imagesize.php on line 6
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /nfs/cust/7/04/28/582407/web/imagesize.php:6) in /nfs/cust/7/04/28/582407/web/imagesize.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /nfs/cust/7/04/28/582407/web/imagesize.php:6) in /nfs/cust/7/04/28/582407/web/imagesize.php on line 7upload done!!!
Warning: Unknown(): open(/tmp/php-ses/sess_f96b0feb611f10312a4ad92fba3bdb1f, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp/php-ses) in Unknown on line 0
thx for any help!