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:
- Make an Automator workflow that takes a selected set of files (”Get Selected Items”) and creates an archive (”Create Archive”) out of them
- 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.
- Store the file on S3, and then output the full S3 url for capture by Automator.
- Use the Automator “New Mail Message” action, passing in the url as the content of the message
- Plan on manually addressing the message, filling out the body if you like.
- 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?
Tags: automator, dropbox, programming, s3

29. March 2008 at 07:09
Cool idea. I may have to roll one that uses my own web server (yes, I’m cheap).
29. March 2008 at 08:18
Yeah, I might just switch mine over to use ftp, or WebDAV, or some custom cgi uploader. I feel weird paying Amazon for file storage, when I’ve already paid for it elsewhere.
That said, S3 is probably surprisingly cheap for personal use on stuff like this. I bet I’d probably pay $1/year for my usage patterns on it. I think my account is at $.06 right now, and it won’t change for a long time because I’m still hundreds and sometimes thousands of units below the next incremental charge. If I started dropping GB sized files, that would change much faster, but I’ve noticed I tend to stick below 100MB/file when I do work like this.
My favorite part on the whole project was rediscovering how Automator workflows saved as applications work. That’s just a simple way to make droplets. It’s something I was trying to remember how to do a couple weeks back, and was going down a more complicated route of pipes and mountpoints and loopbacks and gummy bears and…
29. March 2008 at 11:06
BTW, I discovered that the Upload to FTP Automator action makes it easy to convert this to use your own website.
18. April 2008 at 02:04
Hi Brendon,

I already used a script like this to upload files to AWS but I had a problem since boto Python API has changed
http://toxicsoftware.com/s3_uploader/
So, I would be happy to find a new automator script… I keep on eye on your blog in order to see your code
30. April 2008 at 11:13
about a year ago I came up with a solution to do dropbox for users who are either too stupid or too lazy to actually upload the file themselves. It is a milter (built off of mimedefang, an all-in-one milter solution in perl) that detects large messages, strips out attachments and turns them into dropbox entries on a web server, and replaces the removed attachment with a URL. It worked, I thought it was pretty cool, but we never deployed it because other engineers here were afraid of the consequences of mangled our users mail (nevermind that spam filters mangle mail all the time).