Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/02/2004, 07:58
jcorba
Invitado
 
Mensajes: n/a
Puntos:
Hola,

En la paginas 334/335 del libro "Beginning PHP 4" pone:

If all you want to do is read and print the entire file to the web browser, yo can use the fpassthru() function. This takes a single argument, a FILE HANDLE (obtenido mediante la funcion fopen() ) which it uses to read the remaining data from a file (that is, from the current position until end-of-file). It then write results to standard output.


We can also print the contents of a file without even having to call fopen(), by using readfile(). This function takes a filename as its single argument, READS THE WHOLE FILE, and then writes it to standard output, returning the number of bytes read (or False upon error).


Por lo que yo entiendo readfile lee todo el fichero y luego lo manda (demasiada carga para el servidor), pero fpassthru() tb pone que no pasa la lectura a la salida estandar hasta que no lee todo el fichero.
O yo no me aclaro pero me parece que las dos cosas son igual de malas para leer para descargar ficheros de gran peso.

Alguna interpretación a esta parrafada???

Un saludo
Jose Corbacho