in reply to Re: Download PDF
in thread Download PDF

I have used this a lot with excel and pdf files:
mod_perl example:
$r->content_type('application/pdf'); $r->headers_out->{'Content-Disposition'} = 'attachment; filename=adobe +.pdf'; $r->send_http_header;
Works every time!

Don
WHITEPAGES.COM | INC

Edit by castaway: Closed small tag in signature

Replies are listed 'Best First'.
Re^3: Download PDF
by titanic_fanataic (Acolyte) on Jun 19, 2005 at 01:30 UTC
    I think that you might be on to something, but I'm not sure that I'm sure how to implement this into my script. I tried to add it to my script, but now I get a Software Error:

    Can't call method "content_type" on an undefined value at /vhdocs/rollersports/cgi-bin/dlc/ShotGun.cgi

    Any idea what would cause this error?

      THe example above was mod_perl, you probably got that error because 1) you are not using mod_perl or 2) you are calling your Apache object something other than $r. In the case of #1, a CGI.pm example follows:
      use CGI qw(:standard); print header( 'type' => 'application/pdf', 'attachment' => 'adobe.pdf' );

      Don
      WHITEPAGES.COM | INC

      Edit by castaway: Closed small tag in signature