The MU forums have moved to WordPress.org

Amazon S3 and XMLRPC (4 posts)

  1. Firestorm ZERO
    Member
    Posted 15 years ago #

    I'm currently trying to add the ability to upload files (photos, etc.) to Amazon S3. The majority of our blog users use Windows Live Writer to write their posts because they are most familiar with it (as we are switching from another blog system to WP MU).

    Now the issue is, I have to hack away at the xmlrpc.php file. I just want some opinions if what I am doing is the best way (as I am still not familiar with WP).

    In the mw_newMediaObject function, I see

    do_action('xmlrpc_call', 'metaWeblog.newMediaObject');

    which I assume is a hook for the uploading of files. But the hook occurs before the upload. So basically what I did is comment some of the code so that it does the following..

    - upload the file temporary to the blog server
    - copy it to S3
    - delete the file on the blog server
    - return the S3 url path

    Is there any other way? I would ideally like to make a plugin or some sort. Because the issue of updating means, I have to keep replacing the xmlrpc.php and keep track of it changes/updates.

  2. andrea_r
    Moderator
    Posted 15 years ago #

    Did you try searching for existing plugins already?

  3. Firestorm ZERO
    Member
    Posted 15 years ago #

    There was only 2 Amazon S3 plugins I found. TanTanNoodles which doesn't seem supported anymore and undesign (which I used his S3 PHP class to make my changes).

    But both plugins are only for using the web admin interface to post (My blog writers use Live Writer which I uses the XML-RPC). Also you have to manually select the S3 storage (adds a button on the "Add Media" bar) to upload to S3.

  4. Firestorm ZERO
    Member
    Posted 15 years ago #

    I'm guessing no one else does this? Moving files to a CDN can really help on performance for a heavy blog site.

    Where do I go to suggest changes to the Wordpress core? Ideally it would be good to separate the upload mechanism into an abstract layer and have like drivers to allow the choosing of how to upload. Like S3 has it's own API but some CDNs use FTP and so forth.

About this Topic

  • Started 15 years ago by Firestorm ZERO
  • Latest reply from Firestorm ZERO