Browser File Download
This code will cause the browser to begin downloading a file from the server
my $file = "/mnt/web/mydomain/thisfile.something";
print STDOUT "Content-type:application/octet-stream\r\n";
print STDOUT "Content-Disposition: inline;
filename=$file\r\n\r\n";
open(FILE, $file) or die "Could not open file: $!\n";
while() {print}
close FILE or die "Could not close file: $!\n";
|
|