sample app using Rails3, carrierwave, Jquery File Upload to store images on S3.
JavaScript Ruby
Failed to load latest commit information.
app validating on delete of each and all files Oct 27, 2011
config init commit Oct 21, 2011
db init commit Oct 21, 2011
doc init commit Oct 21, 2011
lib init commit Oct 21, 2011
log init commit Oct 21, 2011
public added support to V5 Oct 23, 2011
script init commit Oct 21, 2011
vendor Added shadowbox support. Oct 25, 2011
.gitignore untracking uploads folder Oct 23, 2011
Gemfile - Added best_in_place support. Oct 25, 2011
Gemfile.lock - Added best_in_place support. Oct 25, 2011
README.textile edited readme Oct 26, 2011
Rakefile init commit Oct 21, 2011 init commit Oct 21, 2011




Sample app using Rails 3.1, carrierwave and V5 of jquery-file-upload to upload and store files on Amazon S3.


The old version of the app using Rails 3 and V4 of jquery-file-upload can be found here

The backgrounder branch delays the entire upload process to S3 thanks to carrierwave backgrounder and delayed job


  • Clone or fork the github repo
  • cd into app directory
    $: bundle install       #install required gems
    $: rake db:create:all   #create dbs
    $: rake db:migrate      #migrate db
    $: rails s              #start app


Since this app stores files to amazon S3 you will need an Amazon S3 account, otherwise you can choose to store images on your local filesystem by editing the uploader:

    # Choose what kind of storage to use for this uploader:
      storage :file     #stores files locally
    # storage :fog      #stores files on S3

Amazon S3 support is made possibile by Fog

You will need to tell carrierwave to use Amazons S3 by creating an initializer and providing your Amazon S3 authentication details:

    CarrierWave.configure do |config|
      config.fog_credentials = {
        :provider               => 'AWS',                                      # required
        :aws_access_key_id      => 'amazon s3 access key',                     # required
        :aws_secret_access_key  => 'amazon s3 secret access key',              # required
        :region                 => 'us-west-1'                                 # optional, defaults to 'us-east-1'
      config.fog_directory  = 'yourbucketname'                                 # required
      config.fog_host       = ''        # optional, defaults to nil
      config.fog_public     = false                                            # optional, defaults to true
      config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}           # optional, defaults to {}

Image Processing:

MiniMagick is app default for processing images; if you want to use another library, just edit the Gemfile and modify the uploader to reflect your choice:

    # Include RMagick or ImageScience support:
    # include CarrierWave::RMagick
      include CarrierWave::ImageScience
    # include CarrierWave::MiniMagick



  • testing