Groups
Conversations
All groups and messages
Send feedback to Google
Help
Training
Sign in
Groups
ruby-aws
Conversations
About
Groups keyboard shortcuts have been updated
Dismiss
See shortcuts
How do I set content disposition header?
201 views
Skip to first unread message
Christian Fazzini
unread,
Jan 12, 2012, 9:00:43 PM
1/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ruby...@googlegroups.com
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?
Reply all
Reply to author
Forward
0 new messages