On Mon, August 22, 2005 12:30 pm, Evert | Rooftop wrote:
I want to use a PHP script to pass through a file to the browser [
right
after some processing ].
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Actually, it's a Fine Idea *IF* the
Message -
From: Evert | Rooftop [EMAIL PROTECTED]
To: PHP-Users php-general@lists.php.net
Sent: Monday, August 22, 2005 9:30 PM
Subject: [PHP] Files passing through
Hi People,
I want to use a PHP script to pass through a file to the browser [ right
after some processing ].
What
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
}
fclose ($fd);
exit;
}
Is there a reason why you assign the
On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
}
Richard Lynch wrote:
On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
Benchmark it both ways and see.
I benched this with a 100 MiB text file (largest I could find at short
notice). Buffer used for fread() calls was 2 KiB as above.
Values are averaged over 100 runs (I would have liked to do more, but I don't
have time). All values are to 4 significant
Hi People,
I want to use a PHP script to pass through a file to the browser [ right
after some processing ].
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Is fpassthrough the right choice?
maybe virtual, so it won't go through php but
This one time, at band camp, Evert | Rooftop [EMAIL PROTECTED] wrote:
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Why not?
Kevin
--
Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Why not?
My guess would be because file_get_contents returns the contents as a
string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
of memory to store that string while
This one time, at band camp, Philip Hallstrom [EMAIL PROTECTED] wrote:
My guess would be because file_get_contents returns the contents as a
string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
of memory to store that string while echo() spits it back out.
But I'm just
Kevin Waterson wrote:
This one time, at band camp, Philip Hallstrom [EMAIL PROTECTED] wrote:
My guess would be because file_get_contents returns the contents as a
string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
of memory to store that string while echo() spits it
11 matches
Mail list logo