RE: how to stream a movie file with fread

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

 



if i may...

what exactly are you trying to do. are you simply trying to get a single
movie to stream... are you trying to get a better feel for how/what
streaming is?

-bruce


-----Original Message-----
From: Graham Anderson [mailto:grahama@xxxxxxxx]
Sent: Friday, September 23, 2005 4:07 PM
To: php
Subject:  how to stream a movie file with fread


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

-- 
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