* Thus wrote Mohamed Lrhazi ([EMAIL PROTECTED]):
> On Tue, 2003-10-14 at 17:33, Curt Zirzow wrote:
> > > 
> > >     //use fopen() instead of readfile...
> > >     $fp = fopen($filepath, 'rb');
> > >     $pdf_buffer = fread($fp, $filesize);
> > >     fclose ($fp);
> > > 
> > >     print $pdf_buffer;
> > 
> > Loading the whole file in memory and not doing anything with it
> > before sending it to the client doesn't make much sense.
> 
> Are you saying readfile() somehow avoids loading the whole file into
> memory? maybe it does, you learn everyday, I am just wondering...

Correct, readfile() doesn't load the whole file into memory.

Imagine if readfile did read the whole thing into memory. and you
have a script was sending 100MB files to the users and then 10 people
happend to come across your site at the same time. your system will
require, at minimum, 1000MB's of memory to send the files. And cross your
fingers the site doesn't get posted to a BBs.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

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

Reply via email to