note 18091 added to function.fopen
| From: | westbx at volny dot cz | Date: | Thu, 10 Jan 2002 09:37:14 +0000 |
| Subject: | note 18091 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24614@lists.php.net to get a copy of this message | ||
How to control a displaying JPEG files (send binary files to STDOUT)?
<?PHP
$filename=$file; // string constant contain complete path to img file
$fp=fopen($filename, "rb");
header( "Content-type: image/jpeg\nContent-Disposition: inline;
filename=\"mypic.jpg\"\nContent-length: ".(string)(filesize($filename)) );
fpassthru($fp);
fflush();
?>
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+18091
http://master.php.net/manage/user-notes.php?action=delete+18091
http://master.php.net/manage/user-notes.php?action=reject+18091