Improve speed of downloading files from webmin by using a 1MB buffer

This commit is contained in:
Mads Mætzke Tandrup
2013-06-18 14:03:29 +02:00
parent e965d744a1
commit a86cebd731

View File

@@ -53,8 +53,8 @@ if ($ENV{'PATH_INFO'}) {
print "Content-type: application/zip\n\n";
open(FILE, $temp);
unlink($temp);
while(<FILE>) {
print $_;
while(read(FILE, $buffer, 1000000)) {
print("$buffer");
}
close(FILE);
}
@@ -83,8 +83,8 @@ if ($ENV{'PATH_INFO'}) {
@st = stat($file);
print "Content-length: $st[7]\n";
print "Content-type: $type\n\n";
while(<FILE>) {
print $_;
while(read(FILE, $buffer, 1000000)) {
print("$buffer");
}
close(FILE);
}