Setup Paperclip plugin with Amazon S3 to upload videos in rails
This is taken from Clayton Lengel-Zigich. Thanks.
Create a video model.rb
Configure the config/s3.yml file
Configure and install right_aws gem
Then run: sudo rake gems:install & sudo rake gems:unpack
Create a videos controller with the prospective views for the uploading
Configure flash player to display video
1. Download JW FLV MEDIA PLAYER (mediaplayer.zip download link)
2. Copy and paste the player.swf file at public/flash/player.swf
3. Copy and paste the swfobject.js at public/javascript/swfobject.js
4. Configure your application.html.erb file to call swfobject.js in the head
That’s it, you should now be able to upload flv video files and view them in a flash player by going to http://localhost:3000/videos. For instructions on converting quicktimes videos to flash videos on file upload take a look at Jim Neath’s tutorial on converting videos with rails.
Development vs Production mode
It’s a good idea to create a bucket for development and a bucket for production. If you decide to, you can do the following.
Note:this assumes you started your app with bort, and already have a settings.yml that gets loaded by the load_config.rb file using APP_CONFIG = YAML.load_file(”#{RAILS_ROOT}/config/settings.yml”)[RAILS_ENV].symbolize_keys)
In config/settings.yml
In video.rb

Clayton | November 23, 2008
Thanks for the backlink!
ovamode | December 27, 2008
Thanks, this has helped a lot.
Only one questions, when retrieving the video I get this:
The bucket you are attempting to access must be addressed using the specified endpoint.
It looks like the path should be https://yourbucketname.s3.amazonaws.com/videos/
instead of
https://s3.amazonaws.com/yourbucketname/videos/
ovamode | December 27, 2008
Just found out that is the uri scheme for european located s3 bucket, ie : http://{bucket name}.s3.amazonaws.com/{object relative name}