appoxy / aws

Amazon Web Services (AWS) Ruby Gem
https://rubygems.org/gems/aws
236 stars 87 forks source link

How do I set content disposition header? #103

Closed krzkrzkrz closed 12 years ago

krzkrzkrz commented 12 years ago

How do I set content disposition header with the aws gem?

I tried:

s3 = Aws::S3.new(APP_CONFIG['amazon_access_key_id'], APP_CONFIG['amazon_secret_access_key'])
bucket_gen = Aws::S3Generator::Bucket.create(s3, 'bucket_name')
signed_url = bucket_gen.get(URI.unescape(URI.parse(URI.escape(Video.first.encoded_file_url)).path[1..-1]), 10.minute, {'response-content-disposition' => 'attachment'})
puts signed_url

When I navigate to signed_url, the file loads and is played on the browser, instead of a download file dialogue popping up.

I looked at the aws gem documentation at: http://rubydoc.info/gems/aws/2.4.5/frames http://rubydoc.info/gems/aws/2.4.5/Aws/S3Generator/Bucket:get

And the AWS documentation at: http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html?r=7673

Any ideas?

krzkrzkrz commented 12 years ago

Created a pull request https://github.com/appoxy/aws/pull/104