Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: Catalyst::Request::Upload inside-out-object weirdness

by ikegami (Pope)
on Mar 26, 2010 at 15:39 UTC ( #831181=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Catalyst::Request::Upload inside-out-object weirdness
in thread Catalyst::Request::Upload inside-out-object weirdness

[The indexing is messed up for this thread. My earlier reply isn't showing, so I'm reposting it]

Looks like

$headers->content_type
can return more than one value. Replace it with
scalar($headers->content_type)


Comment on Re^5: Catalyst::Request::Upload inside-out-object weirdness
Select or Download Code
Re^6: Catalyst::Request::Upload inside-out-object weirdness
by andye (Curate) on Mar 26, 2010 at 15:43 UTC
    you're right. amending catalyst::engine to say

    my $u = Catalyst::Request::Upload->new ( size => $upload->{size}, type => $headers->content_type, headers => $headers, tempname => $upload->{tempname}, filename => $upload->{filename}, ); use Data::Dump +er; die '$headers: +'.Dumper($headers). 'type:'.Du +mper($headers->content_type). '$u:'.Dump +er($u). "\nek!";

    gives

    [error] Caught exception in engine "$headers:$VAR1 = bless( { 'content-disposition' => 'form-data; name="SourceFile +_1"; filename="aaa.jpg"', 'content-type' => 'image/jpeg; charset=utf-8; Content +-Transfer-Encoding: binary' }, 'HTTP::Headers' ); type:$VAR1 = 'image/jpeg'; $VAR2 = 'charset=utf-8; Content-Transfer-Encoding: binary'; $u:$VAR1 = bless( { 'aaa.jpg' => undef, '/tmp/P3v6fH2JR6' => 'filename', 'HTTP::Headers=HASH(0x40e9e58)' => 'tempname', 'type' => 'image/jpeg', 'charset=utf-8; Content-Transfer-Encoding: binary' => + 'headers', 'size' => 374205 }, 'Catalyst::Request::Upload' ); ek! at /Library/Perl/5.8.6/Catalyst/Engine.pm line 556."
    so it looks like $headers->content_type is indeed returning two values. I'll suggest a patch.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://831181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2014-08-29 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls