Source: show | on GitHub
# File lib/carrierwave/storage/s3.rb, line 70 def initialize(uploader, path) @uploader = uploader @path = path end
# File lib/carrierwave/storage/s3.rb, line 119 def about s3_object.about end
# File lib/carrierwave/storage/s3.rb, line 135 def content_disposition s3_object.content_disposition end
# File lib/carrierwave/storage/s3.rb, line 139 def content_disposition=(new_disposition) s3_object.content_disposition = new_disposition end
# File lib/carrierwave/storage/s3.rb, line 127 def content_type s3_object.content_type end
# File lib/carrierwave/storage/s3.rb, line 131 def content_type=(new_content_type) s3_object.content_type = new_content_type end
Remove the file from Amazon S3
# File lib/carrierwave/storage/s3.rb, line 100 def delete AWS::S3::S3Object.delete @path, @uploader.s3_bucket end
# File lib/carrierwave/storage/s3.rb, line 123 def metadata s3_object.metadata end
Returns the current path of the file on S3
# File lib/carrierwave/storage/s3.rb, line 82 def path @path end
Reads the contents of the file from S3
# File lib/carrierwave/storage/s3.rb, line 93 def read AWS::S3::S3Object.value @path, @uploader.s3_bucket end
# File lib/carrierwave/storage/s3.rb, line 147 def s3_object @s3_object ||= AWS::S3::S3Object.find(@path, @uploader.s3_bucket) end
# File lib/carrierwave/storage/s3.rb, line 143 def store s3_object.store end
Returns the url on Amazon’s S3 service
# File lib/carrierwave/storage/s3.rb, line 111 def url if @uploader.s3_cnamed ["http://", @uploader.s3_bucket, "/", @path].compact.join else ["http://s3.amazonaws.com/", @uploader.s3_bucket, "/", @path].compact.join end end