Perl: the Markov chain saw | |
PerlMonks |
Re: optimization of browser uploadby domm (Chaplain) |
on May 16, 2002 at 19:19 UTC ( [id://167088]=note: print w/replies, xml ) | Need Help?? |
except for the 1024. What is its purpose? As vladb pointed out, this limits the amount of data read. If you upload a 3 GB file without using some value for the buffer size, (I think) all the 3 GB would be loaded into memory, thus probably crashing your server. By using the technique you mentioned, you only load 1024 byte into memory, write them to the filehandel, read the next 1024, and so on. is there anyway of giving a progress report will a file is uploading - the status bar at the bottom of an IE4 window gives no reflexion of how much long the file will take to transfer. There is Apache::UploadMeter which does this, but I never used it. I think it requires mod_perl.
-- #!/usr/bin/perl -w just another perl hacker print+seek(DATA,$=*.3,@-)?~~<DATA>:$:__DATA__
In Section
Seekers of Perl Wisdom
|
|