Need help? Check out our Support site, then

Upload Image using xmlrpc.php (SCRIPT!)

  1. Does anyone have a script (preferably php) that I can use to upload an image to my blog by calling xmlrpc.php?

    Example: take the image, and upload a copy of it to blog so that I can reference it in a post.

    Note: This is used in our blogs which are translations of Cuban bloggers because we want to preserve the images since they often go away in the original blog. Right now, we just reference the original image in our translated posts but that has resulted in losing images when the original Cuban post is moved or deleted.

    The blog I need help with is

  2. The metaWeblog.newMediaObject will work for uploading files via XML-RPC.

  3. Thanks...I am looking at the docs for metaWeblog.newMediaObject but am a novice at using XML-RPC. So I understand the function call itself but not the overall way one would use it in a php script.

    Do you perhaps have some example code?

  4. Using the IXR library that comes with WP it's pretty easy:

    $data = array(
        'name'  => 'andy.avi',
        'type'  => 'video/x-msvideo',
        'bits'  => new IXR_Base64( dirname( __FILE__ ) . '/MVI_0649.AVI' )
    $rpc = new IXR_Client( $rpc_url );
    $status = $rpc->query(

    You may want to try the support forums as well, there's nothing specific to in this.

  5. Many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic