Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Content headers for PDF?

by shotgunefx (Parson)
on Jun 10, 2001 at 00:14 UTC ( [id://87248]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: Content headers for PDF?
in thread Content headers for PDF?

I'm using Linux/Apache but I think I know what your problem is. I think it has to do with additional headers being added. I believe IIS determines automatically whether or not to add headers. Removing all the additional headers besides type and putting CGI.pm in nph mode fixed it for me. Opens in one window on IE 5.0 on a win32 machine.

#!/usr/bin/perl use CGI qw(:all -nph ); $|++; my ($offset,$bytes,$buffer,$contents); open(PDF, "</tmp/pdftest.pdf") || die ("Couldn't open file $pr +int_pdf");; $offset = 0; $contents = ''; binmode PDF; until(eof(PDF)) { $bytes += read(PDF,$buffer, 1048576, $offset); $offset += 1048576; $contents .= $buffer; } close PDF; print header( -type => 'applicatio +n/pdf' ); print $contents;


-Lee

"To be civilized is to deny one's nature."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87248]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.