[Tutor] XML-RPC data transfers.

Lee Harr missive at hotmail.com
Fri Dec 29 18:24:48 CET 2006

>Using this example I get error's about 'expected binary .read(), but got
>instance instead.

I assume you are using this ...

>d = xmlrpclib.Binary(open("C:\\somefile.exe").read())

Are you using windows?

I think you would need to pass the binary flag to open ...

        imagedata = open(filename, 'rb').read()

It's probably a good idea to use the binary flag if you are expecting
binary data just in case it gets ported somewhere else later.

>I've just been using xmlrpclib and simplexmlrpcserver for this, but I'm
>wondering if I should perhaps use twisted instead.

I've used xml-rpc to send image data before. It worked.

Don't just search. Find. Check out the new MSN Search! 

More information about the Tutor mailing list