On Tuesday 19 August 2008 16:41:40 Carl Franks wrote:
> You'll still need the body($fh) bit to send the data, too.

Or, if you use Catalyst::Plugin::Static::Simple, you can use:

$c->serve_static_file($file_path);

some code snippets from that method:

    $c->res->headers->content_type( $type );
    $c->res->headers->content_length( $stat->size );
    $c->res->headers->last_modified( $stat->mtime );
..
        my $fh = IO::File->new( $full_path, 'r' );
..
            binmode $fh;
            $c->res->body( $fh );

-- 
Bogdan Lucaciu
http://www.wiz.ro

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to