【发布时间】:2015-02-04 20:53:55
【问题描述】:
如何使用新的 AWS S3 PHP 开发工具包通过“公共读取”更新 S3 中的项目:似乎只能进行 GET 和 PUT? http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.S3.S3Client.html
迭代器返回一个数组,而不是一个类。获取对象返回一个类,但没有明显的更新方法。 CopyObject 似乎有点 hack?
$s3->copyObject(array(
'Bucket' => 'media',
'Key' => $k,
'CopySource' => 'media'.'/'.$k,
'ACL' => 'public-read',
));
返回:
PHP Fatal error: Uncaught Aws\S3\Exception\InvalidRequestException: AWS Error Code: InvalidRequest, Status Code: 400, AWS Request ID: FC630F89A049823A, AWS Error Type: client, AWS Error Message: This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes., User-Agent: aws-sdk-php2/2.5.3 Guzzle/3.8.1 curl/7.35.0 PHP/5.5.9-1ubuntu4.4 thrown in /.../vendor/aws/aws-sdk-php/src/Aws/Common/Exception/NamespaceExceptionFactory.php on line 91
【问题讨论】:
标签: php amazon-web-services amazon-s3 guzzle