All objects in S3 system are stored in buckets. Bucket has to be created before any storage operation. Bucket name is unique in the system, so you can not have bucket named the same as someone else's bucket.
Bucket name can contain lowercase letters, digits, periods (.), underscores (_), and dashes (-). No other symbols allowed. Bucket name should start with letter or digit, and be 3 to 255 characters long. Names looking like an IP address (e.g. "192.168.16.255") are not allowed.
createBucket()creates a new bucket.cleanBucket()removes all objects that are contained in a bucket.-
removeBucket()removes the bucket from the system. The bucket should be empty to be removed.Example 752. Zend_Service_Amazon_S3 Bucket Removal Example
<?php
require_once 'Zend/Service/Amazon/S3.php';
$s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
$s3->cleanBucket("my-own-bucket");
$s3->removeBucket("my-own-bucket");
-
getBuckets()returns the list of the names of all buckets belonging to the user.Example 753. Zend_Service_Amazon_S3 Bucket Listing Example
<?php
require_once 'Zend/Service/Amazon/S3.php';
$s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
$list = $s3->getBuckets();
foreach($list as $bucket) {
echo "I have bucket $bucket\n";
}
isBucketAvailable()check if the bucket exists and returnsTRUEif it does.




