[Catalyst] Out of Memory - File delivery issue

Lukas Thiemeier spamcatcher at thiemeier.net
Thu May 2 12:16:12 GMT 2013


Hey Craig,

don't "print" in your Controller!

As Neil stated: Passing the response Object to the model and using it as
a Filehandle is the way to go. Not using the Catalyst response object
and printing directly is not what he suggested.

There is no need to "print" your HTTP Header. You can set
$c->res->header(...), and still use $res to stream the output to the
client. The same goes for your "RenderView" problem.  RenderView
forwards to a view if the value of $c->res->body is undefined. (It's all
in the docs). Just set $c->res->body(""), and you are fine. No need to
override the end method.

If this does not work for you for any reason, use 'around end =>
sub{...}' and avoid calling $self->$orig if the action matches your
export action. But as I said, I think setting the body do an empty
string should work for you.

Lukas



More information about the Catalyst mailing list