Giter VIP home page Giter VIP logo

carrierwave-dropbox's Introduction

Carrierwave uploads on Dropbox

This gem allows you to easily upload your medias on Dropbox using the awesome Carrierwave gem.

Installation

First, you have to create a Dropbox app. You can either create a "full dropbox" or "app folder" application. Please see this wiki for further information and gotchas.

Then, add this line to your application's Gemfile:

gem 'carrierwave-dropbox'

And make sure that it get installed running the bundle command. Then, you have to run the rake authorize command to authorize your application to access to your Dropbox.

If you are using Rails, the Rake task is automatically loaded. Otherwise, if you aren't running a Rails application, first load the task in your Rakefile:

load "carrierwave/dropbox/authorize.rake"

Then you have to run this task:

rake dropbox:authorize APP_KEY=app_key APP_SECRET=app_secret ACCESS_TYPE=dropbox|app_folder

Finally, you will get your credentials. Config CarrierWave to make it work with your Dropbox:

CarrierWave.configure do |config|
  config.dropbox_app_key = ENV["APP_KEY"]
  config.dropbox_app_secret = ENV["APP_SECRET"]
  config.dropbox_access_token = ENV["ACCESS_TOKEN"]
  config.dropbox_access_token_secret = ENV["ACCESS_TOKEN_SECRET"]
  config.dropbox_user_id = ENV["USER_ID"]
  config.dropbox_access_type = "dropbox"
end

Note: It's advisable not to directly store the credentials in your files especially if you are using a SCM (e.g. git). You should store these values in environment variables for instance like in the above example.

Then you can either specify in your uploader files the storage or define it globally through CarrierWave.configure:

class ImageUploader < CarrierWave::Uploader::Base
  storage :dropbox
end

Special thanks

This project is highly based on these two gems:

Thanks to their respective authors and contributors!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Please see the LICENSE file for further information.

carrierwave-dropbox's People

Contributors

astratto avatar begin29 avatar mcasimir avatar qinix avatar robin850 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.