WordPress.org

Ready to get started?Download WordPress

Forums

WordPress 2.0 XMLRPC issue.... (24 posts)

  1. Rubsi
    Member
    Posted 8 years ago #

    Hello everyone. I am new to WordPress, it's great so far.

    I am trying to implement an XMLRPC upload via either movable type API or Metaweblog API so that I can get it to upload the text and picture that comes with it.

    I have been getting an error back on the client program (AIBO Entertainment Player 2.0) when trying to use either of those 2 methods.

    I have successfully uploaded just the text with the blogger API method, but I want the picture to go as well.

    I turned on error logging in XMLRPC.php, and the log file created an big ole output which on the last 4 lines said the following:

    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==</value></member></struct></value></param></params></methodCall>

    2006-01-01 20:45:34 Output: (MW) Received 105940 bytes

    2006-01-01 20:45:34 Output: (MW) Uploads not allowed

    Is there an admin option inside WordPress that I have missed to enable image upload this way?

    I have been searching for a while on the forums and on the web and although there is a lot of info out there on wordpress 1.5.1x 2.0 seems to be a bit new, any help you can give would be great thanks!!

  2. Rubsi
    Member
    Posted 8 years ago #

    Please someone tell me if they have ever seen this error in the xmlrpc.log at all?

    2006-01-01 20:45:34 Output: (MW) Uploads not allowed

    If so, is it a wordpress or webserver config issue?

  3. vkaryl
    Member
    Posted 8 years ago #

    Looks like either no one else has the problem, or those who do aren't around on New Years Day.

    Can't help you - I don't have anything to do with xmlrpc.

  4. Rubsi
    Member
    Posted 8 years ago #

    Well thats ok, I didn't really expect a reply today. It was just my OP was a bit too detailed, I realised that I only needed an answer about the log file message.

    NM I will try a hosted version of WP to see if it has the same issue, that way I will be able to tell if it's my hosting service or not.

  5. vkaryl
    Member
    Posted 8 years ago #

    That's a good idea! Post back when you figure it out, okay? So the next guy with the problem can find an answer by searching....

  6. Rubsi
    Member
    Posted 8 years ago #

    Confirmed.

    I created an account on wordpress.com tested XMLRPC upload and same errors occur at the client end (though since I can't see the actual log file on that server, I have to assume it is the same error on the server).

    Output: (MW) Uploads not allowed

    So basically at this point the question is:

    Can Movable Type API or Metaweblog API upload pictures via XMLRPC.php on WordPress 2.0 ?

    If they work with other clients, then I will just have to assume that it's the Aibo Entertainment Player 2.0 that is incompatible in some way with XMLRPC.

  7. vkaryl
    Member
    Posted 8 years ago #

    Hopefully someone with some info for you will show up eventually - may be tomorrow though!

  8. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    There's a bug in the XMLRPC uploader in 2.0. The problem is fixed in the repository. You can fix it manually by following these instructions.

  9. Rubsi
    Member
    Posted 8 years ago #

    Implemented changes as on that link.

    Sadly it doesn't appear to fix my problem, I still get the following error in my xmlrpc.log file with the MetaWeblog API:

    Output: (MW) Uploads not allowed

    same thing for the Moveable Type API.

    Again XMLRPC.php only seems to transfer the data correctly when no picture is sent (like when using Blogger API).

  10. Rubsi
    Member
    Posted 8 years ago #

    OK here is the piece of code in XMLRPC.php that writes the error out to the xmlrpc.log file:

    if(!get_settings('use_fileupload')) {
    // Uploads not allowed
    logIO('O', '(MW) Uploads not allowed');
    $this->error = new IXR_Error(405, 'No uploads allowed for this site.');
    return $this->error;
    }

    where is this use_fileupload variable set in WP2.0? I can find no other reference to it anywhere else in the code.

  11. Rubsi
    Member
    Posted 8 years ago #

    To add even more confusion to this, it seems that the above block of code only exists in the ecto version of xmlrpc.php, not the version released with wordpress 2.0.

    This suggests to me that it maybe an obsolete option.

  12. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    You have to be an Editor or Administrator to upload files. Authors can't upload files. You can promote the Author to an Editor or use the Role Manager Plugin to give Authors the 'upload_files' capability.

  13. Rubsi
    Member
    Posted 8 years ago #

    Thanks Ryan, the account is an admin however.

  14. davez0r
    Member
    Posted 8 years ago #

    I have the same problem using MarsEdit (http://ranchero.com/marsedit/) and Ecto, neither can upload anything (in my case, images). If I copied the xmlrpc.php file from 1.5.2 would that cause any problems and if not would it work?

  15. Rubsi
    Member
    Posted 8 years ago #

    This is now fixed for me (though may have other issues later on), at least for the time being.

    First I followed the information here these instructions as suggested by ryan.

    Then I edited the xmlrpc.php file that came from those instructions and commented out this block of code:

    if(!get_settings('use_fileupload')) {
    // Uploads not allowed
    logIO('O', '(MW) Uploads not allowed');
    $this->error = new IXR_Error(405, 'No uploads allowed for this site.');
    return $this->error;
    }

    This may be a bad idea long term, but until another fix is available it will have to do. Once again need to stress that the use uploading was an admin user.

  16. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    I didn't notice that he pointed to an older version of xmlrpc.php. That version will not work as is because it has the obsolete check for use_fileupload. Commenting out that check is fine.

  17. Rubsi
    Member
    Posted 8 years ago #

    Great that resolves it for sure for me. For other AIBO owners out there wanting to use wordpress as your blog, I also added this little bit of code in the xmlrpc.php (section added in strong text) file at around line 874:

    $prefix = '/';

    if(!empty($name)) {

    $prefix_img = '';

    if(preg_match ("/^img.jpg$/i", $name)) {
    $prefix_img = date('U');
    }

    // Create the path
    $localpath = $file_realpath.$prefix.$prefix_img.$name;
    $url = $file_url.$prefix.$prefix_img.$name;

    if (mkdir_p(dirname($localpath))) {

    It gets around the AIBO Entertainment Player 2.0 loading all the images with the same name (img.jpg) for each blog entry (thereby overwriting the image every time).

  18. pcmike
    Member
    Posted 8 years ago #

    I suspect this is the cause for my difficulties in posting video from Audioblog to my WP 2 site...

    (datailed here http://wordpress.org/support/topic/53747?replies=30)

    Now... I'm too inept with WP to follow all the code that Rubsi used to solve his problem but I'd bet that the reason I can't post my XMLRPC code from Audioblog is the same...

    Does that sound logical?

  19. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    Yes, it's the same problem. I'll try to make a replacement xmlrpc.php available that you can drop in over your current one.

  20. kickass
    Member
    Posted 8 years ago #

    Ryan, did you ever get this xmlrpc.php file done? I'd like to drop it into pcmike's site since the patchy fixes didn't seem to do the job.

  21. vkaryl
    Member
    Posted 8 years ago #

    Here's what seems to be the relevant trac link:

    http://trac.wordpress.org/ticket/2202

  22. Rubsi
    Member
    Posted 8 years ago #

    To help out here is a link to the 2 files you need to fix it for WP 2.0 (unless there is a better patch out there yet):

    1) take this file:

    http://pughjones.net/functions-post.php.ppj

    Rename it to same without the .ppj on the end
    and replace the one you have in wp-includes (backup the one you have first)

    2) take this file:

    http://pughjones.net/xmlrpc.php.ppj

    rename it to same name without the .ppj on the end
    replace the one you have in root dir (backup again before you do).

    cross fingers........:)

  23. plunderbund
    Member
    Posted 8 years ago #

    i'm not able to get to the functions-post.php.ppj file...

  24. plunderbund
    Member
    Posted 8 years ago #

    OK, I think I found the changes in those files and copied them over (via the code changelog here: http://trac.wordpress.org/ticket/2202)

    In audioblog, I now get to where it asks me to select a category from wordpress but the categories are not there...if i go ahead and publish, it says successful but the blog is not updated.

Topic Closed

This topic has been closed to new replies.

About this Topic