I need to download a 200MB file from server. I wrote a server side porgram in perl like this
- $ID = $xmlPath."PSIRT_EOX_OFFLINE.txt";
-
-
-
if ($ID eq '') {
-
print "Content-type: text/html\n\n";
-
print "You must specify a file to download.";
-
} else {
-
print "Content-Type:application/x-download\n";
-
print "Content-Disposition:attachment;filename=PSIRT_EOX_OFFLINE.txt\n\n";
-
open(DLFILE, "$ID") || Error();
-
@fileholder = <DLFILE>;
-
-
#binmode(DLFILE);
-
-
close (DLFILE) || Error ('close', 'file');
-
-
print "Content-Type:application/x-download\n";
-
print "Content-Length: $size\n";
-
print "Content-Disposition:attachment;filename=PSIRT_EOX_OFFLINE.txt\n\n";
-
print @fileholder ;
When I execute the perl script through browser, it takes around two mins time to popup the file download dialog. How can the time be reduced? Any help?