RE: [PHP] Streaming a jpg
| From: | Matthew Loff | Date: | Fri, 10 Aug 2001 20:52:42 +0000 |
| Subject: | RE: [PHP] Streaming a jpg | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62218@lists.php.net to get a copy of this message | ||
This should work...
header("Content-Type: image/jpeg");
$image = fopen($filename, "r");
echo fread($file, filesize($filename));
fclose($file);
(... Copied almost verbatim from PHP manual entry for fread() ...)
-----Original Message-----
From: Todd Cary [mailto:todd@aristesoftware.com]
Sent: Friday, August 10, 2001 3:15 PM
To: php-general@lists.php.net
Subject: [PHP] Streaming a jpg
If I know the location and name of a jpeg file, can I stream it to a
HTML page?
What I have is a DB that contains the path and name of jpeg files. These
files are "outside of the www Home directory" for security reasons. I
would like to access the files from my PHP script and stream them to the
page.
Never having done any streaming (PHP files) with PHP, I am not sure if
this can be done and if it can, how to do it.
Many thanks for any guidance........
Todd
--
Todd Cary
Ariste Software
todd@aristesoftware.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net