To upload new objects with reduced redundancy set use the following line of code.
$result = $s3->batch()->create_object($bucket, $filename, array( 'fileUpload' =>$file, 'storage'=>'REDUCED_REDUNDANCY' ) );
To change existing objects redundancy setting .
$result = $s3->change_storage_redundancy( $bucket, $filename, 'REDUCED_REDUNDANCY' );
Here is how to list all of the objects in a bucket. Not recommended if you have lots objects.
$result = $s3->list_objects($bucket);
foreach( $result->body->Contents as $r ) {
echo $r->Key;
}
I'm using the Simple PHP S3 Class. I hope you have found this useful.
No comments:
Post a Comment