我决定利用亚马逊新的 s3 服务器端加密,但是,我遇到了一个无法解决的问题。
我正在使用此处找到的 s3 PHP 类:https://github.com/tpyo/amazon-s3-php-class https://github.com/tpyo/amazon-s3-php-class
我最初一直使用这段代码来放置对象(并且它正在工作):
S3::putObjectFile($file, $s3_bucket_name, $file_path, S3::ACL_PRIVATE,
array(),
array(
"Content-Disposition" => "attachment; filename=$filename",
"Content-Type" => "application/octet-stream"
)
);
然后我按照这里的指示做了:http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTObjectPUT.html http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTObjectPUT.html并添加了 'x-amz-服务器端-加密' 请求头。但现在,当我尝试放置一个对象时,它会失败而不会出现错误。
我的新代码是:
S3::putObjectFile($file, $s3_bucket_name, $file_path, S3::ACL_PRIVATE,
array(),
array(
"Content-Disposition" => "attachment; filename=$filename",
"Content-Type" => "application/octet-stream",
"x-amz-server-side-encryption" => "AES256"
)
);
有人尝试过这个新功能吗?或者有人能看到代码中的错误吗?
Cheers.