Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: MediaWiki::API->upload() problem

by choroba (Canon)
on Sep 27, 2011 at 15:22 UTC ( #928103=note: print w/ replies, xml ) Need Help??


in reply to MediaWiki::API->upload() problem

Have you tried googling for HTTP::Message content must be bytes at? Suggests an encoding problem...


Comment on Re: MediaWiki::API->upload() problem
Replies are listed 'Best First'.
Re^2: MediaWiki::API->upload() problem
by spekulum (Initiate) on Sep 27, 2011 at 15:47 UTC

    Yes, and I don't find solutions on old threads.

      Yes, and I don't find solutions on old threads.

      What do you mean?

      The solution is to only give bytes not utf or decoded_content

        Any decode functions don't work.

        $response return code of data in image format, i. e. png, jpg

        Some examples:

        $response = $response->content() if($response->is_success()); die Dumper($response);
        $ perl test.pl $VAR1 = '&#9618;PNG IHD&#9618;6n&#9618;sRGB&#9618;&#9618;&#9618;gAMA&#9618;&#9618; &#9618;a cHRMz&&#9618;&#9618;&#9618;&#9618;&#9618; +u0&#9618;`:&#9618;p&#9618;&#9618;Q<!IDATWc&#9618; &#9618;*1&#9618;&#9618;Ig&#9618; &#9618;&#9618;&#9618;+(&#9618;&#9618;K&#9618;&&#1432;IEND&#9618;B`&#96 +18;';
        $response = $response->decoded_content() if($response->is_success()); die Dumper($response);
        $ perl test.pl $VAR1 = '&#9618;PNG IHD&#9618;6n&#9618;sRGB&#9618;&#9618;&#9618;gAMA&#9618;&#9618; &#9618;a cHRMz&&#9618;&#9618;&#9618;&#9618;&#9618; +u0&#9618;`:&#9618;p&#9618;&#9618;Q<!IDATWc&#9618; &#9618;*1&#9618;&#9618;Ig&#9618; &#9618;&#9618;&#9618;+(&#9618;&#9618;K&#9618;&&#1432;IEND&#9618;B`&#96 +18;';
        $response = $response->content() if($response->is_success()); $response = utf8::downgrade($response); die Dumper($response);
        $ perl test.pl $VAR1 = 1;
        Probably, needs to use some specific libs for work with it?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2015-07-28 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls