I'm storing images in a MySQL database, and displaying them when needed - and that program seems to work just fine. Passes the image type, size and filename via the headers to IE without a problem. Now I'm considering reducing the quality of the images (from 100% down) so I'm playing with the imagejpeg() routine - however, now when that program (see code) sends the image type, size and filename to IE - it displays the image fine, but if you right click - it has no filename, size and IE thinks it's a .png? Can anyone spot something I'm doing drastically wrong? - basically I'm uploading a file from the PC - first I'm converting it to 400 x 600 at 100% and display it. Once I get IE working properly with the headers, then I'll add in other quality %'s and see how the image changes and file size changes - to determine the best quality % for the database.

What I don't want is a discussion on whether to store the images in a database vs storing them in a directory. They each have their merits and problems - but I've already weighed them out.

I'm thinking whatever problem might be specific to IE - I tried Firefox and Chrome and they both pick up the information correctly . I'm using IE 9 on Win 7.

PHP Code:
         $image $_FILES['image'];

         
$info=getImageSize($image['tmp_name']);
         
$itype="image/jpeg"$image['type']=$itype;
         
$icontent=file_get_contents($image['tmp_name']);
         
$imgstr=imagecreatefromstring($icontent);
         
$imgw1=imagesx($imgstr); $imgh1=imagesy($imgstr);
         
$before=strlen($icontent);

         
ob_start();
         
imagejpeg($imgstrnull100);
         
$imageorig ob_get_contents();
         
ob_end_clean();
         
$pcorig strlen($imageorig);

# imageorig - Image original size and 100% quality

         
$imgstro=imagecreatefromstring($imageorig);
         
$imgw=imagesx($imgstro); $imgh=imagesy($imgstro);
         
$imgstrx=imagecreatetruecolor(400,600);
         
imagecopyresized($imgstrx$imgstro0000400600$imgw$imgh);
         
$imgw2=imagesx($imgstrx); $imgh2=imagesy($imgstrx);

         
ob_start();
         
imagejpeg($imgstrxnull100);
         
$imgstrf ob_get_contents();
         
ob_end_clean();
         
$pcorigsz strlen($imgstrf);

# imgstrf - Image at 400 x 600 size and 100% quality


         
header("Content-Type: {image/jpeg}"); 
         
header("Content-Length: ".$pcorigz); 
         
header("Content-Disposition: inline; filename=Image00041.jpg");
         
header("Content-Transfer-Encoding: binary"); 
         
header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0");
 
         print 
$imgstrf;
         exit;