Method: Gluttonberg::Library::Storage::S3::ClassMethods#upload_file_to
- Defined in:
- lib/gluttonberg/library/storage/s3.rb
#upload_file_to(asset, bucket_key, mime_type, local_file) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/gluttonberg/library/storage/s3.rb', line 68 def upload_file_to(asset, bucket_key, mime_type, local_file) = { :expires => (Time.now+1.years).rfc2822, :acl => :public_read } mime_type = asset.mime_type if mime_type.blank? [:content_type] = mime_type unless mime_type.blank? response = bucket_key.write(File.open(File.join((Rails.env == 'test' ? Engine.root : Rails.root),local_file)), ) puts "Copied" end |