Beware the Bear!
This plugin is an attempt to make a more plug and play version of github.com/nathancolgate/s3-swf-upload-plugin
Right now it’s very unstable and only being tested against Ruby 1.9.2 and Rails 3.0.3.
Things to Know
-
S3Bear is only support Rails 3 and Ruby 1.9.2
-
S3Bear is tested against IE7, IE8, Firefox 3.6, Chrome 8, Chrome 9 and Safari 5
-
S3Bear is Flash free for modern browsers but must fallback to SWFUpload for IE because it doesn’t support the FileAPI. Which really is a shame :(
S3 Bear builds upon Paperclip’s functionality so get it setup first.
Add to your Gemfile and run bundle install
gem 's3bear', :git => 'git://github.com/cracell/s3bear.git'
Run:
rails generate s3_bear:install
Setup the initializer
Go to config/initializers/s3bear.rb Either change the access keys or setup your local system to export them
Run the setup rake to setup the bucket
bundle exec rake s3bear:setup_upload_bucket
Add Stylesheet to your layout
= stylesheet_link_tag 's3_bear/base'
Add Jquery and the s3bear scripts to your layout
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> = javascript_include_tag 's3_bear/s3bear', 's3_bear/postmessage'
Add bearify. Make sure the tag matches the paperclip field names
bearify :attached_image
Add to your form
= render :partial => 'shared/s3bear', :locals => {:f => f, :target => :attached_image_url}
Currently only supports a single uploader per page (though this uploader can be a multiple file uploader) Currently only supports S3 buckets with a public-write ACL. Malicious users could upload anything to this bucket and use it to serve files to others. Requires Paperclip Requires Rails 3
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
-
Fork the project
-
Start a feature/bugfix branch
-
Commit and push until you are happy with your contribution
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2011 Eric Cranston. See LICENSE.txt for further details.