Amazon S3: Simplifying image uploads in your blogging workflow
Almost a year ago, I switched to Amazon S3 for hosting the images that are part of my blog posts. It has been a great move, and has kept me happy, and hasn’t cost me a lot (given that I don’t pull so much traffic anyway). However, there has always been the occasional moment where I have found the change in my workflow to be tedious. The fact that instead of just pulling the images into LiveWriter (the application I use to blog) and pushing the publish button, I had to first use CloudBerry Explorer (an excellent application for Amazon S3) to upload the image to S3, then get it’s URL, and then embed it into my post.
So, today I thought to myself, maybe I should consider writing a WordPress plug-in for automating this task on the WordPress end. And the moment that thought came to me I almost kicked myself. Because I was suddenly 100% sure that someone probably already did that (I should have searched for it an year ago). But better later than never, I say. And so, when I searched, there it was waiting: Amazon S3 plugin for WordPress, by the author of tan tan noodles blog.
The rest of the article is about making it work for my setup.
The plug-in is straight forward enough, you install it as usual – by dropping it in your plug-ins directory and activating it from the admin panel. Once you do that, there are some options to setup as shown below:
The keys you will find in your Amazon Web Services account. And some of the other settings are dependent upon how you setup your S3 account. By the way, if you choose the setting for “Bucket is setup for virtual hosting”, it might give you a warning message that the DNS is not configured properly (it did in my case), but I ignored the warning, and it works fine for me.
Now, the moment you set this up, the plug-will use whatever configuration you have for your file uploads to create a directory structure in the Amazon Bucket you chose. So, if you have an existing setup you may have to tweak it a little to make it compatible.
In my case, I had a folder called blog in my bucket under which the images were kept and I had chosen to adopt the same standard that WordPress uses when it organizes the folders into years and months. So, all I had to do was go to the Miscellaneous Settings screen and change the upload folders storage path to blog:
One undesirable side effect of doing this was that my media library broke. Not that I use it, and not that it will make any difference to the past posts (from when I used to upload the images to WordPress instead of Amazon S3). But, then all I had to do to fix it was to copy the contents of wp-content/uploads (my earlier setting) to a newly created folder in the root called blog.
And that’s it, I was done. Now all the images I post from LiveWriter automatically get uploaded to my designated Amazon S3 bucket. And it makes it much easier for me to deal with them.
Update: As sad as this sounds, the plug-in is not working as expected. For me, it loads the files to Amazon S3, but it also retains a copy on my webhost. And the links that are created in the post are from the webhost instead of links from Amazon S3. I will try and either fix the plug-in myself, or try to find a fix on the Internet (and requesting the author).
If you enjoyed reading this blog, consider subscribing to the RSS feed. You can also subscribe to it by email. You can also follow me on Twitter. Thank you!
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.





June 22nd, 2009 at 11:53 am
Thanks for making a post about Amazon S3 Wordpress plug-in!
October 28th, 2009 at 6:34 am
You only did half the step my friend and that’s why you say it uploads to Amazon S3 and not going displaying. That’s because this plugin only does the upload only. What you need is another plugin that will translate a jpg etc to the amazon URL. Anyway go check out the wordpress plugin here:
http://wordpress.org/extend/plugins/search.php?q=cdn
I think My CDN or CDN Rewrite would be the choice.
October 28th, 2009 at 9:44 am
Thanks Daniel for your comment. I will check it out. Cheers.