how to stream a movie file with fread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to stream a movie file with 'fread'
this my first step in trying to dynamically encrypt the file as it is being streamed from the server

do I need to fread the data in chunks?
If so, how?

$filename ="$path2file";
$file = fopen($filename,'r');
$fileSize = filesize($filename);
$ContentType = " video/quicktime";
header ("Content-type: $ContentType");
header ("Content-length: $fileSize");

while( $filedata_temp = fread($file, $fileSize) )
echo $filedata_temp;

<b>Fatal error</b>: Allowed memory size of 16777216 bytes exhausted (tried to allocate 24113191 bytes) in <b>xxxxxxxx/fopenTest.php</b> on line <b>27</b><br />

BTW, I can get readfile to work just fine :)
AFAIK, readfile does not parameters to alter the file contents

many thanks :)

g

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux