我只是想知道这是否是一个错误,我的错误或者有没有人成功地得到这个工作
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'
)
这会吐出一个签名网址
我可以得到一个URL出了这一点,但:response_content_type
&放大器; :响应内容处置
选项似乎并没有做任何事情。
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.
这些都记录在 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?
修改我想通了:如果有人跑进相同的 - 需要正确的创业板不是AWS / S3的AWS-SDK(有两种漂浮在那里与pretty的大同小异code - 我认为后者是一个老版本)
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-S3
是一个老版本的 AWS-SDK 。很多他们之间code只是,即使你掉了要求
头的工作原理。使用 AWS-SDK
来解决这个问题。
Hi guys answering it myself.. aws-s3
is an old version of aws-sdk
. Lots of code between them just works even if you swap the require
header. Use aws-sdk
to fix this problem.
上一篇:PHP Imagick:直接写入图像到Amazon S3?图像、直接、Imagick、PHP
下一篇:AWS SDK的NoClassDefFoundError:com.amazonaws.services.s3.AmazonS3ClientNoClassDefFoundError、com、AWS、SD