[jifty-devel] Downloading files

Henry Baragar Henry.Baragar at instantiated.ca
Tue Dec 12 09:22:14 EST 2006


Hello all,

What is the standard way to download a file in Jifty?  I am generating CSV 
files from a database for downloading into spreadsheets.

The way I would do it in Mason would be to put the following in a template 
file:

<%init>
    use Apache::Constants qw/OK/;
    $m->clear_buffer;
    $r->content_type('text/comma-separated-values');
    $r->send_http_header();
    $m->print(csv_data());
    $m->abort(OK);
</%init>

It occurs to me that this should all go into the Dispatcher.  However, I am 
worried that manipulating the request and Mason objects in this way will 
interfere with what Jifty does.

Furthermore, there ought to be an easier way to do it!-)

Thanks,
Henry


More information about the jifty-devel mailing list