Forse this sarebbe di aiuto per PHP 2? Usa il framework Guzzle che non conosco.
Esegue un comando HeadObject: L'operazione HEAD recupera i metadati da un oggetto senza restituire l'oggetto stesso. Questa operazione è utile se sei interessato solo ai metadati di un oggetto. Per utilizzare HEAD, è necessario disporre dell'accesso READ all'oggetto.
tentativo finale utilizzando Guzzle framework (codice non testato):
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",
));
// HEAD object
$headers = $client->headObject(array(
"Bucket" => "your-bucket",
"Key" => "your-key"
));
print_r($headers->toArray());
PHP 1.6.2 Soluzione
// 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']);
di credito a: http://docs.aws.amazon.com/AWSSDKforPHP/latest/#m=AmazonS3/get_object_metadata
Speranza che aiuta !
qualunque lingua specifica che stai cercando? Potrei gettare un campione insieme se sapessi come volevi farlo. 'GetObjectMetaData' farebbe esattamente questo. – EFeit
Beh, avrebbe senso. Non l'ho visto elencato per PHP in questa pagina http://docs.aws.amazon.com/aws-sdk-php-2/guide/latest/service-s3.html. Di solito usiamo Java ma, a causa dell'ambiente in cui ci troviamo, stiamo usando PHP. – Michael