2008/8/19 Bogdan Lucaciu <[EMAIL PROTECTED]>: > 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 );
Thanx Carl, Bogdan and Oliver for your responses. Sorry if I wasn't clear to begin with. This method will work well for binary files. I have opted $c->response->header() method for now. Much appreciated. Dp. _______________________________________________ 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/
