George_Sherston has asked for the wisdom of the Perl Monks concerning the following question:
I shd add that the "action" in the form is "my_file.pl?ext=.pdf" - that is, I think I've done all this good stuff to stop IE5 getting confused. And test.pdf is a real PDF file - if I link directly to it, I see what I expect to see. BUT the output from the above code is not a PDF file, but the "source code" of the PDF. I have a feeling I must be doing something very simple wrong... can any kind monk tell me what?use CGI qw/:standard/; open PDF, "test.pdf" or die "cd not open test.pdf"; my $buffer; read PDF, $buffer, -s(PDF); print header( -type => "application/pdf\n\n", ), $buffer;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Outputting PDF via CGI
by zengargoyle (Deacon) on Mar 23, 2002 at 00:19 UTC | |
|
Whoop! Whoop! Whoop! Header Oversight Alert!
by George_Sherston (Vicar) on Mar 23, 2002 at 00:24 UTC |