【问题标题】:How to create an European Amazon S3 Bucket using Zend_Service_Amazon_S3如何使用 Zend_Service_Amazon_S3 创建欧洲 Amazon S3 存储桶
【发布时间】:2011-12-23 14:11:27
【问题描述】:

使用 Zend_Service_Amazon_S3,您可以使用以下代码创建存储桶:

$s3 = new Zend_Service_Amazon_S3($key, $secretKey);
$s3->createBucket('my-fantastic-bucket');

createBucket 的第二个参数是'location'。在欧洲(爱尔兰)创建存储桶需要哪个值?

【问题讨论】:

    标签: php zend-framework amazon-s3


    【解决方案1】:

    您提供实际位置的位置名称。

    每个位置都有一个名称,因此您只需输入该名称即可。

    http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTBucketPUT.html

    Specifies the Region where the bucket will be created
    
    
    Valid Values: EU | us-west-1 | ap-southeast-1 | ap-northeast-1 | empty string (for the US Classic Region)
    
    Default: US Standard
    
    Ancestor: CreateBucketConfiguration
    

    所以你的代码可以是这样的:

    $s3 = new Zend_Service_Amazon_S3($key, $secretKey);
    $s3->createBucket('my-fantastic-bucket', 'us-west-1');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-24
      • 2015-09-14
      • 2019-07-14
      • 2017-11-13
      • 1970-01-01
      • 2023-03-31
      • 2016-08-25
      相关资源
      最近更新 更多