Gets the cumulative file size of the contents of the Amazon S3 bucket.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the bucket to use. |
|
|
Optional |
A value of |
Returns
Type |
Description |
---|---|
The number of bytes as an integer, or the friendly format as a string. |
Examples
Get the size of the contents of a bucket, in bytes.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_filesize($bucket); // Success? var_dump($response);
Get the size of the contents of a bucket, measured in the largest reasonable unit.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_filesize($bucket, true); // Success? var_dump($response);
Related Methods
Source
Method defined in services/s3.class.php | Toggle source view (35 lines) | View on GitHub