> Adam Gent wrote:
> >Hi,
> >
> >There is no reason why it can not be all done within the C::A.
> >
> >If the run mode generates the file and saves it to disk as a temporary
> >The run mode can then output the correct header.
> >
> >
> What would the "correct header" there be?
> Do you mean redirect the client to the temporary file that has been
> generated?
> The other thing that I wanted to do was clean up the temporary file that
> was created after it has been sent to the user.  This is achievable if
> C::A's run() method outputted the file itself (the cleanup code could
> then go in teardown()), but not if it just sent a redirect header.
> - Steve


You can change the header in C::A to output the header

print header(-type => "text/comma-separated-values",
     -attachment => "download.csv");

Through the header_props method is C::A, which goes via CGI.pm


So you can then do

 $webapp->header_props(-type => "text/comma-separated-values",
     -attachment => "download.csv");

Should work fine.

You can also do this for zip and pdf files, if you set the correct header

ie.    application/zip


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.517 / Virus Database: 315 - Release Date: 08/09/2003

Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to