Created
March 17, 2015 03:12
-
-
Save urielhdz/dba98dfb9aec70156718 to your computer and use it in GitHub Desktop.
Upload video to GCS using Fog and PaperClip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module HasVideoConcern | |
extend ActiveSupport::Concern | |
included do | |
has_attached_file :mp4_video_file, | |
:storage => :fog, | |
:fog_credentials => { | |
provider: 'Google', | |
google_storage_access_key_id: '', | |
google_storage_secret_access_key: '' | |
}, | |
:fog_directory => "" | |
validates_attachment_content_type :mp4_video_file, | |
:content_type => ["video/mp4", "application/mp4", "audio/mp4","video/vnd.objectvideo","video/mp4","video/mpeg4-generic"] | |
has_attached_file :webm_video_file, | |
:storage => :fog, | |
:fog_credentials => { | |
provider: 'Google', | |
google_storage_access_key_id: '', | |
google_storage_secret_access_key: '' | |
}, | |
:fog_directory => "" | |
validates_attachment_content_type :webm_video_file, :content_type => 'video/webm' | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment