Catalyst-Plugin-ServeFile
view release on metacpan or search on metacpan
serve_file (@path_parts, ?\%options?)
Will serve a static file using '$c->config->{root}' as the path prefix.
For example if you have a file '$c->config->{root}/static/license/html'
you can serve it with $c->serve_file('static','license.html').
This method will return true (the $fh actually) if it is successful in
locating and serving a file. False otherwise. It doesn't automatically
set any 'not found' response, you need to handle that yourself.
If the last argument is a HashRef, we will use it as an overlay on any
configuration options.
See the \SYNOPSIS for a longer example.
CONFIGURATION
This plugin supports the following configuration. You may set
configuration globally via the 'Plugin::ServeFile' configuration key,
and you may set/override when making the request. For example:
package MyApp;
lib/Catalyst/Plugin/ServeFile.pm view on Meta::CPAN
=head2 serve_file (@path_parts, ?\%options?)
Will serve a static file using '$c->config->{root}' as the path prefix. For example
if you have a file '$c->config->{root}/static/license/html' you can serve it with
$c->serve_file('static','license.html').
This method will return true (the $fh actually) if it is successful in locating and serving
a file. False otherwise. It doesn't automatically set any 'not found' response, you need to
handle that yourself.
If the last argument is a HashRef, we will use it as an overlay on any configuration options.
See the L<\SYNOPSIS> for a longer example.
=head1 CONFIGURATION
This plugin supports the following configuration. You may set configuration globally
via the 'Plugin::ServeFile' configuration key, and you may set/override when making
the request. For example:
package MyApp;
( run in 0.588 second using v1.01-cache-2.11-cpan-49f99fa48dc )