adding Content-Disposition to header to allow for browsers to recognize
it's a PDF by default, etc.
This commit is contained in:
parent
e072492215
commit
ab75e5b88c
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue