open(DB, "<$filename") or die "couldn't open $filename for download: $!"; print "Content-Title: $filename\n"; print "Content-Disposition: attachment; filename=$filename\n"; print "Content-Type: application/octet-stream; file=$filename\n\n"; binmode DB; binmode STDOUT; my $buff; while( read(DB, $buff, 1024) ) { print STDOUT $buff; } close(DB);