我下载了AWS SDK并将其存储在此文件的同一目录中,但是每个简单的脚本都会出现此错误:
"Fatal error: Undefined class constant 'ACL_PUBLIC_READ'"
此脚本用于在s3上传一个简单的png图像:
require 'aws.phar';
$bucket='example';
use Aws\S3\S3Client;
use Aws\Common\Enum\Region;
$client = S3Client::factory(array(
'key' => 'mykey',
'secret' => 'mysecretkey'
));
$client->putObject($_FILES['myfile']['tmp_name'], $bucket , 'file.png', S3Client::ACL_PUBLIC_READ);
我该如何解决?
答案 0 :(得分:0)
SDK 2.x中不存在该常量。我想你正在寻找这个:
http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.S3.Enum.CannedAcl.html