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

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


Steve Comrie wrote:

Setting $self->header_type('none'); followed by printing the headers
yourself and then opening a file in the run-mode and printing it line by
line and finally followed by return ''; *should* hypothetically solve the
problem without relying on undocumented CGIApp features.

Exactly.  Yes, it does solve the problem - I've just tried it.  Thanks!

A fairly un-elegant solution but then again it's a fairly irregular
scenario. I'd imagine that if it's something an application will be doing
regularly, a function in the superclass like:

sub return_file_contents
[snip]

and could then be called at the bottom of the run-mode returning the file
as:

return $self->return_file_contents( '/usr/home/files/information.pdf',
'Product Information.pdf' );

Not a bad idea.  I'll give that a go too.

Cheers,
- 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.