开发者

php amazon s3 bucket creation

开发者 https://www.devze.com 2022-12-20 07:26 出处:网络
We try to create a bucket on Amazon S3............. what\'s wrong with this code???????????? $req =& new HTTP_Request(\"http://s3.amazonaws.com/[bucket-name]\");

We try to create a bucket on Amazon S3............. what's wrong with this code????????????

$req =& new HTTP_Request("http://s3.amazonaws.com/[bucket-name]"); 
$req->setMethod("PUT"); 
setAuthorizationHeader($req); 
$req->sendRequest(); 

if ($req->getResponseCode() == 200)
{     
    // bucket was created 
} 
else 
{     
  开发者_运维百科  // something bad happened 
}


You might want to look at the Pear implementation of an S3 Client as a reference (it's still in alpha)

0

精彩评论

暂无评论...
验证码 换一张
取 消