App-ZofCMS
view release on metacpan or search on metacpan
lib/App/ZofCMS/Plugin/SendFile.pm view on Meta::CPAN
=head1 SYNOPSIS
In your ZofCMS Template or Main Config File:
plugins => [ qw/SendFile/ ],
plug_send_file => [
'../zcms_site/config.txt', # filename to send; this one is outside the webdir
'attachment', # optional to set content-disposition to attachment
'text/plain', # optional to set content-type instead of guessing one
'LOL.txt', # optional to set filename instead of using same as original
],
In your HTML::Template template:
<tmpl_if name='plug_send_file_error'>
<p class="error">Got error: <tmpl_var escape='html' name='plug_send_file_error'></p>
</tmpl_if>
=head1 DESCRIPTION
lib/App/ZofCMS/Plugin/SendFile.pm view on Meta::CPAN
B<NOTE:> unless an error occurs, the plugins calls C<exit()> when it's done sending the file,
make sure that all the required plugins had their chance to execute BEFORE this one.
=head2 C<plug_send_file>
plug_send_file => 'foo.txt', # file to send
plug_send_file => [
'../zcms_site/config.txt', # filename to send; this one is outside the webdir
'attachment', # optional to set content-disposition to attachment
'text/plain', # optional to set content-type instead of guessing one
'LOL.txt', # optional to set filename instead of using same as original
],
plug_send_file => sub {
my ( $t, $q, $conf ) = @_;
return 'foo.txt';
},
B<Mandatory>. Takes either a string, subref or an arrayref as a value, can be specified in
either ZofCMS Template or Main Config File; if set in both, the value in ZofCMS Template is
( run in 2.926 seconds using v1.01-cache-2.11-cpan-524268b4103 )