I have a site that is running on AppFog.com, and they don't have persistent file storage for things like images uploaded through the wordpress media uploader.

The theme I am making for the site includes the Amazon S3 PHP class for some other functionality - and I have that working. What I would now like to do is hook that into the media uploader so that when images are uploaded to my site they also get uploaded to Amazon S3.

So I guess what I want is to know what filters are used when uploading media so that I can hook into them and also upload the images (and the relevant thumbnails) to S3. I tried looking through the source but haven't had any joy so far.

I should point out that I don't really want to use a plugin to do this - but I am happy to learn from a plugin if anyone has any pointers.

Also - since I am using AppFog I don't have access to the server and so can't install anything beyond PHP apps.

  • 1
    See if you can work out what you need from this plugin.
    – s_ha_dum
    Jun 8, 2013 at 14:09
  • I've looked at that plugin. It uses the Clouse storage system (oblaksoft.com/documentation) which seems to need to add some sort of addon to mysql - which is something I can't do unfortunately. You're right that I may be able to use some of the code as a starting point though so will look into it some more.
    – BinaryMoon
    Jun 8, 2013 at 14:58
  • 2
    I was mostly looking at the (significant number of) hooks it uses.
    – s_ha_dum
    Jun 8, 2013 at 15:23
  • It's true - there's a lot. I'm looking at it at the moment :)
    – BinaryMoon
    Jun 8, 2013 at 15:28

1 Answer 1


So I worked out what I was looking for. It seems that all images, when edited or uploaded, have something passed through wp_update_attachment_metadata and so I can hook into that to get the info I need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.