Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Latest commit

 

History

History
37 lines (22 loc) · 1.32 KB

README.markdown

File metadata and controls

37 lines (22 loc) · 1.32 KB

uploadd

Minimal file upload daemon using Rainbows

Rails plugin here: paperclip_uploadd

Installation

gem install rainbows
gem install rack-contrib
git clone git://github.com/capotej/uploadd.git

Configuring

Edit config.ru and change SECRET to something secure, like the word "password"

Running

cd /path/to/uploadd
nohup rainbows &

That's it! Now you should have a scalable upload server running on :8080

Usage

Here's an example of how to use it (requires httpclient gem):

HTTPClient.post 'http://localhost:8080/up', { :file => File.new('/path/to/file.jpg'), :filename => 'users/avatar/12, :secret => "redrum" }

But is it fast?

Video of the logs with 10 workers uploading images from another server

Notes

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

Rails plugin

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.