Minimal file upload daemon using Rainbows
Rails plugin here: paperclip_uploadd
gem install rainbows
gem install rack-contrib
git clone git:https://github.com/capotej/uploadd.git
Edit config.ru
and change SECRET
to something secure, like the word "password"
cd /path/to/uploadd
nohup rainbows &
That's it! Now you should have a scalable upload server running on :8080
Here's an example of how to use it (requires httpclient
gem):
HTTPClient.post 'https://localhost:8080/up', { :file => File.new('/path/to/file.jpg'), :filename => 'users/avatar/12, :secret => "redrum" }
Video of the logs with 10 workers uploading images from another server
Uploadd was written to be as simple as possible so it doesn't check for duplicates, it just overwrites. You can feed the filename param a deep directory structure and it'll create all the directories for you below the UPLOAD_DIR
in config.ru
There is a Rails plugin that extends Paperclip to use Uploadd as a backend as opposed to S3 or the local file system, check out paperclip_uploadd.