tags:

views:

45

answers:

1

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 
}
A: 

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

Kenji Baheux