2016-09-17 63 views
0

我是新来的使用aws,特别是aws s3。aws s3证书和受助人drgn

如果我想设置我的PHP脚本/网站把一个对象放入存储桶中,我应该设置一个特定的受让人吗?如果是的话,受让人应该是什么?

或者它应该在我创建安全访问密钥后正常工作。

感谢, 版

+0

你所说的具体的受赠的意思是所有的例子吗? – koolhead17

回答

0
// Upload an object by streaming the contents of a file 
// $pathToFile should be absolute path to a file on disk 
$result = $client->putObject(array(
    'Bucket'  => $bucket, 
    'Key'  => 'data_from_file.txt', 
    'SourceFile' => $pathToFile, 
    'Metadata' => array(
     'Foo' => 'abc', 
     'Baz' => '123' 
    ) 
)); 

// We can poll the object until it is accessible 
$client->waitUntil('ObjectExists', array(
    'Bucket' => $this->bucket, 
    'Key' => 'data_from_file.txt' 
)); 

看看上面的例子,基本上这是你所需要的。 AWS S3-PHP SDK文档已覆盖http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-s3.html

希望它可以帮助