Gets the collective metadata for the given Amazon S3 object.
The MD5 value for an object can be retrieved from the ETag HTTP header for any object that was uploaded with a normal PUT/POST. This value is incorrect for multipart uploads.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the bucket to use. |
|
|
Required |
The file name for the Amazon S3 object. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
If the object exists, the method returns the collective metadata for the Amazon S3 object. If the object does not exist, the method returns boolean |
Examples
Get the metadata for an object.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_metadata($bucket, 'üpløåd/î\'vé nøw béén üpløådéd.txt'); // Success? var_dump($response['ContentType']); var_dump($response['Headers']['content-language']); var_dump($response['Headers']['x-amz-meta-ice-ice-baby']);Result:
string(10) "text/plain" string(5) "en-US" string(18) "too cold, too cold"
Related Methods
Source
Method defined in services/s3.class.php | Toggle source view (63 lines) | View on GitHub