NAME

Catalyst::Plugin::Static::File - Serve a specific static file

VERSION

version v0.1.0

SYNOPSIS

In your Catalyst class:

use Catalyst qw/
    Static::File
  /;

In a controller method:

$c->serve_static_file( $absolute_path, $type );

DESCRIPTION

This plugin provides a simple method for your Catalyst app to send a specific static file.

Unlike Catalyst::Plugin::Static::File,

METHODS

serve_static_file

$c->serve_static_file( $absolute_path, $type );

This serves the file in $absolute_path, with the $type content type.

If the $type is omitted, it will guess the type using the filename.

It will also set the Last-Modified and Content-Length headers.

It returns a true value on success.

If you want to use conditional requests, use Plack::Middleware::ConditionalGET.

SEE ALSO

Catalyst

Catalyst::Plugin::Static::Simple

SOURCE

The development version is on github at https://github.com/robrwo/Catalyst-Plugin-Static-File and may be cloned from git://github.com/robrwo/Catalyst-Plugin-Static-File.git

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Catalyst-Plugin-Static-File/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Robert Rothenberg <rrwo@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Robert Rothenberg.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)