trenchmortar / python-blogger

Automatically exported from code.google.com/p/python-blogger
0 stars 0 forks source link

upload_file method sends <string> instead of <base64> #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The WordPress upload_file method doesn't enocode the xml request properly.
 According to the following support post, it should be wrapped in a
<base64> tag -- I looked at the XML, and the bits param is being wrapped in
a <string>.

http://wordpress.org/support/topic/257938

I've tried using the method as is.  The file uploads, but seems to be
corrupted on the server...

Original issue reported on code.google.com by erik%lin...@gtempaccount.com on 9 Mar 2010 at 11:27

GoogleCodeExporter commented 8 years ago
Never mind.  You just need to pass xmlrpclib.Binary(binary_data) to the bits 
param
and xmlrpclib will take care of the encoding. 

Original comment by erik%lin...@gtempaccount.com on 10 Mar 2010 at 12:20