I’m just wondering if this is a bug, an error on my part or has anyone managed to get this working
>irb
>require 'aws/s3'
>AWS::S3::Base.establish_connection!(
:access_key_id => key,
:secret_access_key => secret)
>AWS::S3::S3Object.url_for(
filename,
bucket,
:use_ssl => true,
:response_content_type=>'text/plain',
:response-content-disposition=>'attachment; filename=text.txt'
)
This will spit out a signed url
I can get a URL out of this but the :response_content_type & :response-content-disposition options don’t seem to do anything at all.
These are documented at
http://docs.amazonwebservices.com/AWSRubySDK/latest/AWS/S3/S3Object.html#url_for-instance_method
Does anyone have luck with adding these per request headers? Or am I doing it wrong?
EDIT I figured it out: If anyone runs into the same – require the right gem not ‘aws/s3’ its ‘aws-sdk’ (there are two floating around out there with pretty much the same code – I think the latter is an old version)
aws-s3is an old version ofaws-sdk. Lots of code between them just works even if you swap therequireheader. Useaws-sdkto fix this problem.