hiho,

it could be a ie-problem, see
http://support.microsoft.com/default.aspx?scid=kb;EN-US;810978

g. martin luethi


Thu, 15 Jan 2004 14:18:29 -0800 Bob Eldred <[EMAIL PROTECTED]>:

> Well, I've done a lot of web searching, and a lot of experimentation, but
> haven't hit upon a fix for my issue yet.
>
> Currently, images are served on a site I'm working on in two ways:
>
> 1) Free Images are served normally (<img src="freepic.jpg">).
> 2) Non-Free Images are served through a PHP wrapper with authentication
> functionality in it (<img src="showpicture.php?pid=111384">).
>
> The issues I'm having *only* occur in Internet Explorer, but it's not the
> full-cache issue that Microsoft acknowledges, and I don't honestly believe
> it to be a total bug in IE, since the free images, served up through a
> normal <img> tag work fine.
>
> The issue is that, if the user right-clicks the image, and chooses "Save
> As", it will only save as a BMP.  Interestingly, if the user right-clicks on
> a link to a picture, and chooses "save target as", it works just fine.
>
> So far, I've tried the following, with no success:
>
> 1) Mod-Rewrite, rewriting a request of /secure/111384.img to
> /showpicture.php?pid=111384.  I did this because it was suggested that IE
> might be looking at the file name in the link, not seeing an image type, and
> therefore defaulting to bmp.  The rewrite works successfully, and the
> picture is shown, but the "save as" function still doesn't work.  Getting
> the image properties from within IE gives a Type of "Not Available".
>
> 2) Adding, rewriting, subtracting, etc, many many header combinations.
>
> 3) All Microsoft-suggested full-cache problem fixes, just in case.
>
> So, the scripts involved are these:
>
> in functions.php:
>
> function showpix($picture_id)
>         {
>         $sql="SELECT ug.group_name, p.name from usenet_groups as ug,
> ipictures as
>  p WHERE p.id='$picture_id' AND ug.id=p.group_id";
>         $result=mysql_query($sql) or die(mysql_error());
>         $row=mysql_fetch_array($result);
>         $dirhash=get_storage_dir($row["name"]);
>         $picturedirectory=STORAGEDIR."/".$row["group_name"];
>         $fullpicturename=$picturedirectory."/".$dirhash."/".$row["name"];
>         header("Content-Type: image/jpeg");
>         header("Content-Length: ".(string)filesize($fullpicturename));
>         header("Content-Disposition: inline;
> filename=\"".$row["name"]."\"");
>
>         readfile("$fullpicturename");
>         return(true);
>         }
>
> The page serving the image:
>
>       <tr><td><a href="/secure/<?=$row["id"]?>.jpg" target="_BLANK">
>       <img src="showpicture.php?type=thumb&pid=<?=$row["id"]?>"><br>
>       <?=$row["name"]."<br>".$row["date_added"]?></a>
>       <?php if($_SESSION["sec_level"]==4)
>       {
>       echo "<br><img onClick=\"rethumbnail({$row["id"]});\"
>               src=\"/graphics/rethumbnail.png\">".SPACER.
>               "<img onClick=\"del_picture({$row["id"]});\"
>               src=\"/graphics/trashcan.png\">";
>       }
>       ?>
>       </td>
>
> showpicture.php:
>       <?php
>       include('dbconnect.php');
>       include('defines.php');
>       include('functions.php');
>       if($_GET["type"]=="temp"||$_GET["type"]=="thumbtemp")
>               {
>                 $sec_level=4;
>                 }
>       else
>                 {
>                 $sec_level=2;
>                 }
>       include('validate_user.php');
>       switch($_GET["type"])
>               {
>               case "thumb":
>                       {
>                       showthumb($_GET["pid"]);
>                       break;
>                       }
>               case "temp":
>                       {
>                       showpixtemp($_GET["pname"], $_GET["gid"]);
>                       break;
>                       }
>               case "thumbtemp":
>                       {
>                       showthumbtemp($_GET["pname"], $_GET["gid"]);
>                       break;
>                       }
>               default:
>                       {
>                       showpix($_GET["pid"]);
>                       }
>               }
>       ?>
>
> Because of the fact that IE can properly determine the image type when
> statically served, I have to believe that something is not being sent
> properly to the browser from within one of these functions.
>
> I apologize for asking this question twice, but having done more research,
> and having unsuccesfully implemented the suggestions given to me last time,
> I'm hoping that someone can point me in the right direction, before I'm
> simply forced to do Apache redirection, which isn't as good as actually
> checking in the session for logged-in status.
>
> Thanks in advance for anything you can throw my way.
>
> Bob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to