in reply to Displaying PDF files via CGI::Application
Thanks to everyone who replied with ideas for helping solve this riddle. Unfortunately (or fortunately, depending on your point of view), the solution was embarrassingly easy. This will definitely be one to put in my "Doh!" files.
At the top of my program, I had my standard bit of code, activated in all of my CGI programs during debugging:
BEGIN { $|=1; if (1) { print "Content-type: text/html\n\n"; # Doh! use CGI::Carp qw(fatalsToBrowser); } }
Doh! While debugging, I start off by printing a text/html content-type, so that if something burps out some text unexpectedly, I'll be seeing the text rather than a mysterious "server 500" error in my browser. That works fine when I'm displaying HTML (I see the extra content-type header at the top of the page, of course), but not when I'm trying to display a PDF.
Once again, with feeling: Doh!
Thanks again to everyone who replied. (And I'm going to look into those Mozilla extensions ASAP!)
Wally Hartshorn
(Plug: Visit JavaJunkies, PerlMonks for Java)
|
|---|