Dropzone extension leveraging Ruby waz-storage gem

It's been a long time since my last post, so today I want to share with you my experience on using the waz-storage gem, created by my friend Johhny Halife. If you are not aware about his amazing job you should check this post to get more context about what I'm going to show you.

What can I do?

After reviewing Johnny's code I was very excited on creating something and to start playing with that toy, but obviously the question was WHAT?

The answer came to my mind while reading a blog about an application for Mac OSX desktop called Dropzone. This is a excerpt taken from Dropzone's website.

"Drag a file onto the dock icon and your fully customizable grid of destinations flies smoothly out using core animation. Drop the file onto a destination and Dropzone will take care of the rest. Whether you're installing an app, uploading a file to an FTP server or sharing your photos on Flickr."

There is a section regarding how to extend the Dropzone's features, and how to contribute creating plugins. Dropzone can easily be extended using simple ruby scripts.

So, I thought about writing a script that allow users to easily drag an drop files from your computer and store them as Blobs on the Windows Azure Storage Services.

Coding for fun!

I started reading the Dropzone Scripting API documentation and I was surprised how easy it was. There are only two methods to implement which are dragged, clicked and that's it.

Beyond the simplicity that gives the Dropzone's API, I had the joy of coding in Ruby and the waz-storage gem easiness.

You can find the source code on the following url http://github.com/jpgarcia/dropzone-user-scripts/blob/master/WAZBlobs.dropzone

How can you try it?

Installation and configuration:

  1. Download the Dropzone program from here
  2. Install the waz-storage gem if the gem isn't installed yet sudo gem install waz-storage --version >= 0.5.4 --source http://gemcutter.org
  3. Download the dropzone extension that I created from the github repositories. The file is called WAZBlobs.dropzone
  4. Open the WAZBlobs.dropzone file and provide your Windows Azure Services credentials as depicted below:

The script and the functionality is very simple:

  1. Drag and drop your files to the Azure's icon on the Dropzone panel
  2. The files will be uploaded to a public container called dropzone.
  3. The following picture shows how the Picture 3, that I dragged & dropped above, is already on Windows Azure Blobs servers. So I will play a little bit with the console to show you that the Blob is already there :)

On my next post I will show you a new application I'm developing on Heroku that uses the same gem to manage the Blobs via Web. Stay tuned!

Published: October 19 2009

  • category:
blog comments powered by Disqus