Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Help downloadin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 1393 of 1483
Post > Topic >>

Help downloading a file

by John.Moon@[EMAIL PROTECTED] (John Moon) May 1, 2007 at 10:56 AM

------_=_NextPart_001_01C78C00.E2607E4C
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Below is code I presently use to download to clients and the generated
html. One client objects to the generated html - the
"Content-Disposition" ... Does any one have another method to download
AND display the pdf with perl.


sub Display_PDF {
    my ($pdf, $pdf_size) =3D @[EMAIL PROTECTED]
    $|=3D0;
    print $q->header(-type=3D>'application/pdf',
        -attachment=3D>'Requested_Re****t.pdf',
        -Content_length=3D>$pdf_size,
        -expires=3D>'+1d',
        -status=3D>'200 OK');
    open RE****T, $pdf;
    while (read RE****T, my $buff, 5000) {
        print $buff
        }
    }

Generates:

Status: 200 OK
Expires: Wed, 02 May 2007 14:53:53 GMT
Date: Tue, 01 May 2007 14:53:53 GMT
Content-Disposition: attachment; filename=3D"Requested_Re****t.pdf"
content-length: 92455
Content-Type: application/pdf

John W Moon


------_=_NextPart_001_01C78C00.E2607E4C--
 




 4 Posts in Topic:
Help downloading a file
John.Moon@[EMAIL PROTECTE  2007-05-01 10:56:22 
Re: Help downloading a file
greg@[EMAIL PROTECTED] (  2007-05-01 12:33:15 
RE: Help downloading a file
Hellman.Matthew@[EMAIL PR  2007-05-01 15:56:04 
Re: Help downloading a file
greg@[EMAIL PROTECTED] (  2007-05-01 12:49:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 11:58:18 CDT 2008.