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 = {}

struct["name"] = "newpicture.jpg"
struct["type"] = "image/jpeg"
struct["bits"] = Base64.b64encode(File.read("newpicture.jpg"))

server.call('metaWeblog.newMediaObject', 'blogid', 'username',
'password', struct)

ERROR:

XMLRPC::FaultException: XMLRPC::FaultException

Failed to invoke method newMediaObject in class
org.apache.roller.weblogger.webservices.xmlrpc.MetaWeblogAPIHandler:
java.lang.String cannot be cast to [B


#end code

Any ideas?

(Using Tomcat 6 and Roller 4.0, uploads are enabled and work through
the web interface.)

Thanks,
Pieter Steyn

Reply via email to