Hi,
Just incase someone has the same problem I had, this is the ruby solution:
image = {
'name' => "img.jpg",
'type' => "image/jpeg",
'bits' => XMLRPC::Base64.new(File.read('/tmp/img.jpg'))
}
Instead of
'bits' => Base64.b64encode(File.read("/tmp/img.jpg"))
Resolved!
Cheers,
Pieter Stey
Thanks Dave,
I have in the meantime also come across a working Perl example:
# Description: This scripts sends a newMediaObject request
use strict;
use warnings;
use Data::Dumper;
use XMLRPC::Lite +trace => qw(debug);
my $username = "username";
my $password = "password";
my $blogid = "blogid
On Feb 3, 2008 7:13 AM, Pieter Steyn <[EMAIL PROTECTED]> wrote:
> struct["bits"] = File.read("newpicture.jpg")
>
> But got the same error.
>
> How would I send a byte array using Ruby? Or any other language,
> could you (or anyone else on the list) perhaps provide me with a
> working sample in any
Hi Dave,
Well according to the MetaWebLog API:
>bits is a base64-encoded binary value containing the content of the object.
So yes, struct["bits"] is a string containing a base64 encoding of the
binary file.
I have however tried sending the binary file as is by doing :
struct["bits"] = File.re
On Feb 1, 2008 3:02 AM, Pieter Steyn <[EMAIL PROTECTED]> wrote:
> Could anyone please tell me what I'm doing wrong?I'm trying to upload an
> image through xmlrpc via a ruby script (have
> tried perl aswel with same results)
>
> Code:
> #Ruby code
> require 'xmlrpc/client'
> server = XMLRPC::Client
Hi guys,
Could anyone please tell me what I'm doing wrong?
I'm trying to upload an image through xmlrpc via a ruby script (have
tried perl aswel with same results)
Code:
#Ruby code
require 'xmlrpc/client'
server = XMLRPC::Client.new(hostname, /roller/roller-services/xmlrpc, 8080)
stuct = {}