Reply to RE: [PHP] how to stream a movie file with fread

Your name:

Reply:


Posted by "bruce" on 09/26/08 11:27

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@siren.cc]
Sent: Friday, September 23, 2005 4:07 PM
To: php
Subject: [PHP] 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация