adding Content-Disposition to header to allow for browsers to recognize

it's a PDF by default, etc.
This commit is contained in:
joshferraro 2005-09-05 22:18:09 +00:00
parent e072492215
commit ab75e5b88c
1 changed files with 3 additions and 1 deletions

View File

@ -28,11 +28,13 @@ use CGI;
# This script take a pdf filename as a parameter and output it to the browser.
my $cgi = new CGI;
my $filename = "barcodes.pdf";
my $tmpFileName = $cgi->param('tmpFileName');
print "Content-Disposition: attachment; filename = $filename\n\n";
print $cgi->header(-type => 'application/pdf'),
$cgi->start_html(-title=>"Codify to PDF");
open fh, "<$tmpFileName";
while (<fh>) {
print;
}
print $cgi->end_html();
print $cgi->end_html();