trouble loading a jpeg image with php
| From: | Didier | Date: | Thu, 10 Apr 2003 10:16:59 +0000 |
| Subject: | trouble loading a jpeg image with php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143303@lists.php.net to get a copy of this message | ||
Hi all,
I have got a few documents, stored outside the web site tree that I need to display inline when my users request it.
I have the following script
$fgm='../documents/waiting/land11.jpg';
$fp = fopen($fgm, "rb") ;
if ( $fp ) {
header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename="land11.JPG"');
fpassthru($fp);
}
and I keep receiving this error
'the image "http://10.11.12.130/handledocs.php" cannot be displayed because it contains errors'
and cannot figure out why, any hint would be more than welcomed.
I have checked that the image can be displayed by the browser (opening it manually with a Open/file ...). It seems to be fine if instead of a .jpg I simply have a text/plain type of file, the document is indeed displayed.
Didier