[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] How to download a dynamically generated file


Eric Andreychek wrote:

On Wed, 10 Sep 2003, Steve Comrie wrote:
You should be able to use the argument of 'none' to the CGIApp header_type()
method.
-------------------
my $filename= 'the_pdf_file.pdf";
my $output = get_pdf_contents();
my $header= "Content-Type: application/octetstream\n";
    $header .= "Content-Disposition: attachment; filename=$filename\n\n";

$self->header_type('none');
return $header.$output;

Agreed, but that only surpresses the headers.  You still have to read in
the entire PDF at once, and then pass it around as a reference.

I think what Steve C was suggesting (correct me if I'm wrong) was for the run-mode to output the headers and the PDF file itself (which it can do in small chunks at a time, instead of all in one go like the example above does), and then set the header type to "none" and return a null string.

Then, C::A's run() method has been instructed to not output headers, and has no content body to output either -- the run-mode has already done it all!

This is the answer I've been looking for.  Thanks, guys!

- Steve


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.