Roll your own dropbox

So I’ve had occasion recently to send out some slightly large .zip files to friends. The problem with doing this is, often the attachments end up too large for some mail server in the mix. The typical way these days around the problem is to use some sort of dropbox web application. Usually you upload your file to the dropbox site, and are presented with a link that you can email to your friend, which then allows them to download the file. Check out filedropper.com for a simple example of such an application.

Of course, I was bored, and don’t like the extra steps of having to archive my files to a zip, browse to a website, click upload, find the file I want, upload it, and delete the archive copy. Granted, there are some quicker solutions out there, but again, I was bored.

So I came up with a tiny solution that costs a few pennies and was fun. All you need is the OS X Automator program, a programming language of your choice (I picked ruby) and a module for interfacing with Amazon’s S3 service.

The procedure is simple. If I have time, and clean up the code enough, I might post it here. But here’s the basic workflow steps:

  1. Make an Automator workflow that takes a selected set of files (“Get Selected Items”) and creates an archive (“Create Archive”) out of them
  2. Pass that archive into a script (“Run Shell Script”) to upload the file to S3. Generate a filename for S3 by hashing some timestamp info, the filename, etc.
  3. Store the file on S3, and then output the full S3 url for capture by Automator.
  4. Use the Automator “New Mail Message” action, passing in the url as the content of the message
  5. Plan on manually addressing the message, filling out the body if you like.
  6. Now here’s what makes it convenient: save the workflow as an application. Drag the saved application to the Dock.

Now I have a droplet on the dock which I can drag any number of selected files to, which will upload to S3, and generate a new mail message with the download link in the message body.

I still need a scheduled job that cleans out old files from the bucket. But the process is fairly easy, works great, and was fun to come up with. Now I admit, for a small solution for use with friends, there’s really no reason to pick Amazon. I could probably just as easily upload to my website, and link from there. But hey, that’s not as “sexy”, right?

—Mar 29, 2008