[Catalyst] HTTP Response body doesn't get sent
Tomas Doran
bobtfish at bobtfish.net
Fri Apr 3 12:45:11 GMT 2009
Terence Monteiro wrote:
> In my Catalyst application, I'm reading an attachment of a multipart
> message into a variable and trying to send it as HTTP response. I've set
> the content type too, but I don't get the file on the browser.
>
> I'm getting the following in the log:
>
> Caught exception in engine "Not a GLOB reference at
> /usr/local/share/perl/5.8.8/Catalyst/Engine.pm line 47."
>
> I'm dumping the same variable contents into a temp file, and on
> checking, it gives me the same content and content length as is being
> set as $c->res->body and $c->res->content_length respectively. I'm using
> Marc Overmeer's Mail::Box module to parse the message and fetch the
> attachment.
>
> Controller action code:
> # fetching $content
> $c->res->body($content);
> my $ctype = $attach->contentType;
> $c->res->content_type($ctype);
Setting the body expects the parameter to be a file handle unless its a
straight scalar.
Your $content, I guess, is a reference to some object, which is what is
causing the issues.
Cheers
t0m
More information about the Catalyst
mailing list