FAQ
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);

In end action:
my ( $self, $c ) = @_;

return 1 in $c->res->body;
...

Ubuntu 8.10
Linux kernel 2.6.27
Perl version 5.10
Catalyst 5.71001
Mail::Box 2.078

Anything else needed?

--
Regards, Terence.
http://www.deeproot.in
Ph: +91 (80) 4089 0000

Search Discussions

  • Tomas Doran at Apr 3, 2009 at 1:45 pm

    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
  • Terence Monteiro at Apr 3, 2009 at 2:02 pm

    On Fri, Apr 03, 2009 at 01:45:11PM +0100, Tomas Doran wrote:
    Terence Monteiro wrote:
    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.
    Thanks a ton! It is indeed a reference to a Mail::Message::Body::Lines
    object. On stringification, the code works!

    --
    Regards, Terence.
    http://www.deeproot.in
    Ph: +91 (80) 4089 0000
  • Octavian Rasnita at Apr 3, 2009 at 2:42 pm
    From: "Terence Monteiro" <terence@deeproot.co.in>
    Thanks a ton! It is indeed a reference to a Mail::Message::Body::Lines
    object. On stringification, the code works!
    Then try to stringify it:

    $c->res->body("$content");

    Octavian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 3, '09 at 1:33p
activeApr 3, '09 at 2:42p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase