[cgiapp] How to send pdf file?
Lou Hernsen
lhernsen1015 at wowway.com
Sun Feb 3 19:02:32 EST 2008
I klnow how to send an email with text.
How to I send an email with HTML in it?
Is there a special header or command or what?
Lou
----- Original Message -----
From: <petr.vojkovsky at centrum.cz>
To: <cgiapp at lists.openlib.org>
Sent: Sunday, February 03, 2008 5:14 AM
Subject: Re:Re: [cgiapp] How to send pdf file?
> Hi Michael,
> thank you for your answer.
> MIME headers are correct, but I still don't know how to send binary output
through CGI::Application.
> On "classic" way it is easy:
> open(FILE, "<test.pdf");
> @fileholder = <FILE>;
> close (FILE);
>
> print "Content-Type: application/pdf\n";
> print "Content-Disposition: attachment;filename=test.pdf\n\n";
> print @fileholder;
>
>
> How to do it through CGI::Application?
>
> Petr
>
> petr.vojkovsky at centrum.cz wrote:
> > Hi,
> > I want send to browser pdf file (it exist):
>
> mpeters at plusthree.com wrote:
> >If it already exists, it's much easier than that. Basically you just tell
the
> >browser where to find the file and what type it is:
>
> >sub send_pdf {
> >my $self = shift;
> >$self->header_type('none'); # let's you set your own headers
> >$self->header_props(
> >-content-type => 'application/pdf',
> >-content-disposition' => 'inline; filename=myfile.pdf'
> >);
> >
> >return 'Download myfile.pdf';
> >}
>
> >Or something like that. It's kind of tricky when you need to deal with
caching,
> >SSL and IE - http://support.microsoft.com/kb/316431, but if you don't
then it's
> >pretty easy.
>
> >--
> >Michael Peters
> >Developer
> >Plus Three, LP
>
>
> ##### CGI::Application community mailing list ################
> ## ##
> ## To unsubscribe, or change your message delivery options, ##
> ## visit: http://lists.openlib.org/mailman/listinfo/cgiapp ##
> ## ##
> ## Web archive: http://lists.openlib.org/pipermail/cgiapp/ ##
> ## Wiki: http://cgiapp.erlbaum.net/ ##
> ## ##
> ################################################################
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.16/1250 - Release Date: 1/29/08
10:20 PM
>
>
More information about the cgiapp
mailing list