lundi 24 août 2015

Retrieve s3 object user metadata in aws sdk v3 php

I'm looking to retrieve user-defined meta-data from objects in my S3 bucket, and I am unaware of how to retrieve it in the php sdk.

As per Editing Object Meta Data, User metadata is stored with the object and returned with it, and begin with "x-amz-meta-"

I have defined user metadata on objects through the console like "x-amz-meta-test", at both upload time, and adding it after the upload (through web console, not the upload API).

The test metadata is never returned. I always get the same system metadata. That is, I get only the following keys in @metadata:

Folder

statuscode
effectiveUri
headers
   x-amz-id-2
   x-amz-request-id
   date
   x-amz-bucket-region
   content-type
   transfer-encoding
   server

Objects

Key
LastModified
   date
   timezone_type
   timezone
ETag
Size
StorageClass

However, it appears to achieve this in other languages, a simple method call is involved.

Get User Metadata in Android SDK

Get User Metadata in Java SDK

Any help would be greatly appreciated :)




Aucun commentaire:

Enregistrer un commentaire