Delete the line with header("Content-disposition:  ... ").  Just set the content type 
and output the file.
-Kevin


"Pushpinder Singh Garcha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Hello Everyone,

   I am trying to display a JPG image to a use, who has logged in. Some 
research on google revealed a way to do this. I am using the following 
code to display it.

if (session_is_registered("valid_user")){

            if(session_is_registered("cmi")){

    header("Content-type: image/jpg");
    $file = "docs/picture1.jpg";
   header("Content-disposition: attachment; filename=$file" );
    readfile($file);

             } 

My question is that while this approach works fine with Mozilla on the 
MAC and Win platform. it throws up a dialog box asking whether the user 
wants to download  the file or view it. However IE on either platforms 
does not work fine. On the PC it does not recognize the file extension 
correctly. While on the MAC side of things, it just shows the image in 
the same frame.

Any suggestions would be most welcome. !

Thanks in advance
Pushpinder Singh


Reply via email to