Example #1

Retrieving all buckets from a S3 account

The following examples illustrates how to retrieve all buckets of a given S3 account. All you need to replace in the snippet are the $key and $secret variables.

<?php
require_once 'Services/Amazon/S3.php';

$key    'your key';
$secret 'your secret';

$s3 Services_Amazon_S3::getAccount($key$secret);

echo 
'<ul>';
foreach (
$s3->getBuckets() as $bucket) {
    echo 
"<li>{$bucket->name}</li>";
}
echo 
'</ul>';

?>
Introduction to Services_Amazon_S3 (Previous) Example #2 and #3 (Next)
Last updated: Mon, 20 Oct 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.