[Catalyst] Large static files behind Authorisation

Trevor Phillips trevor.phillips at gmail.com
Sun Jan 4 11:47:36 GMT 2009

On Sun, Jan 4, 2009 at 7:48 PM, Tomas Doran <bobtfish at bobtfish.net> wrote:
> Just use a stash key to indicate that you have served a file yourself to stop calling TT.. e.g.
> sub serve_stuff : Local {
>    my ( $self, $c ) = @_;
>    $c->serve_static_file('some_file');
>    $c->stash->{file_output} = 1;
> }
> sub end : Private {
>    my ( $self, $c ) = @_;
>    $c->detach('render') unless $c->stash->{file_output};
> }
> sub render : ActionClass('RenderView') {}

That sort of worked! It definitely turned off the template - but I was
getting no file output still, which agrees with what Nickolay said.

I stripped down my download action to the bare minimum and did get it
working - the problem was that I was using :Path :Args to define the
matching path. When I changed to using Local, it worked correctly.

Why should it matter to serve_static_file if I specify :Path :Args or
use Local? The routine was definitely being called either way - just
the file output wasn't working.

Trevor Phillips  - http://dortamur.livejournal.com/
"On nights such as this, evil deeds are done. And good deeds, of
course. But mostly evil, on the whole."
     -- (Terry Pratchett, Wyrd Sisters)

More information about the Catalyst mailing list