[wp-xmlrpc] Uploading images - XML-RPC limitations and AtomPub bugs

Timothy Armes tim at timothyarmes.com
Sun Feb 15 14:09:44 GMT 2009


Hi,

I'm writing a Wordpress client that uploads images to a Wordpress blog
using XML-RPC and/or AtomPub.  I'm having lots of problems relating to
the transfer of metadata (Title, caption & description) and I'm hoping
that someone can help me.

First of all, it seems that it's impossible for me to upload this
information using XML-RPC - can you confirm that this is the case or
am I just being totally blind?

Since I came to a dead with that I've started to implement the AtomPub
protocol.  There are a number of issues that I've come across:

The 'edit' URL returned by Wordpress is incorrect.  POSTing the image
will return something like this:

 <link rel="edit-media"
href="http://www.myblog.com/blog/wp-app.php/attachment/file/491" />
 <link rel="edit" href="http://www. myblog.com/blog/wp-app.php/post/491" />

The edit media URL is correct, however if I do a GET of the edit URL,
to retrieve the metadata, the result is empty.   After looking at the
source I realised that it should have been returning this:

 <link rel="edit" href="http://www.
myblog.com/blog/wp-app.php/attachment/491" />

With this URL the GET works, with the exception that the description
isn't returned in the <content> node.

Now, if I PUT the returned XML with a new <title> and description
(<content>) it works quites well except for the fact that the HTML
entities aren't decoded.  Is there a workaround for this?

Finally I note that the GET correctly returns the image caption in the
<summary> tag, however the PUT ignores it, so I can't update the
summary.

Thanks for your help,

Tim


More information about the wp-xmlrpc mailing list