http://qs1969.pair.com?node_id=52253

I had problems when trying to generate a pdf file with perl and outputting to MSIE 5.0. To fix this, I did content type = application/pdf. Thanks to help from wonderful perl monks I found out that I could do this. :) Thanks for the nifty trick! I just thought I'd share for those who don't know.
the url was simple.... /dumb_perlscript.pl?ext=.pdf
by simply adding .pdf to the end of the URL, Microsoft's dumb MIME content override was tricked.

Replies are listed 'Best First'.
Re: how to output to pdf from a perl script
by merlyn (Sage) on Jan 16, 2001 at 23:01 UTC
Re: how to output to pdf from a perl script
by skeight (Novice) on Jan 25, 2001 at 03:59 UTC
    couldn't you also just do this at the beginning of the html:
    print "Content-type: application/pdf\n\n";
    correct me if I'm wrong but I'm pretty sure this would work

    skeight

      You should certainly be including that in your HTTP header, but IE prefers to pay attention to the file extension. If you have a URL such as http://www.someserver.com/cgi-bin/sendpdf.cgi, and that CGI script generates a PDF file and sends it along, IE won't see it as a PDF, it will see it as a .CGI file.

        Ahhh, Now I see. Thanks for the input on that one. I wasn't aware of that...

        skeight