Maybe this will help PHP 2? It uses a Guzzle framework that I am not familiar with.
Executes the HeadObject command: the HEAD operation retrieves metadata from the object without returning the object itself. This operation is useful if you are only interested in the metadata of the object. To use HEAD, you must have READ access to the object.
Final attempt to use the Guzzle framework (unverified code):
use Guzzle\Service\Resource\Model use Aws\Common\Enum\Region; use Aws\S3\S3Client; $client = S3Client::factory(array( "key" => "YOUR ACCESS KEY ID", "secret" => "YOUR SECRET ACCESS KEY", "region" => Region::US_EAST_1, "scheme" => "http", ));
PHP 1.6.2 Solution
// 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']);
Credit: http://docs.aws.amazon.com/AWSSDKforPHP/latest/#m=AmazonS3/get_object_metadata
Hope this helps!
Efeit source share