This adds functionality to add additional params to the querystring for S3 expiring URLs. The reason for this is if you want to override response_content_type or response_content_disposition with expiring URLs, you have to change Amazon's signature, which gets signed before adding additional options to the querystring. Because it's added later, and because Amazon's signature includes the full URL, the signature is bad and the request fails. To use this feature: has_attached_file :avatar, :s3_url_options => { :response_content_disposition => "inline" } Additionally, you can pass a lambda and it'll be evaluated when the URL is generated. If, for example, the content type is incorrect in Amazon (either empty or application/octet-stream), you can effectively cast the response from Amazon as a particular content type. has_attached_file :avatar, :s3_url_options => lambda {|model| { :response_content_type => model.avatar_content_type } }
Name |
Last commit
|
Last Update |
---|---|---|
.. | ||
matchers | Loading commit data... | |
storage | Loading commit data... | |
attachment.rb | Loading commit data... | |
attachment_options.rb | Loading commit data... | |
callback_compatibility.rb | Loading commit data... | |
geometry.rb | Loading commit data... | |
interpolations.rb | Loading commit data... | |
iostream.rb | Loading commit data... | |
matchers.rb | Loading commit data... | |
missing_attachment_styles.rb | Loading commit data... | |
processor.rb | Loading commit data... | |
railtie.rb | Loading commit data... | |
schema.rb | Loading commit data... | |
storage.rb | Loading commit data... | |
style.rb | Loading commit data... | |
thumbnail.rb | Loading commit data... | |
upfile.rb | Loading commit data... | |
url_generator.rb | Loading commit data... | |
version.rb | Loading commit data... |