title: Retrieve object user metadata in S3 - aws sdk v3 php
body: <p>I'm looking to retrieve user-defined meta-data from objects in my S3 bucket, from the php sdk. </p>
  
  <p>As per <a href="http://docs.aws.amazon.com/AmazonS3/latest/UG/EditingtheMetadataofanObject.html" rel="nofollow">Editing Object Meta Data</a>, User metadata is stored with the object and returned with it, and begin with "x-amz-meta-"</p>
  
  <p>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). </p>
  
  <p>The test metadata is never returned. I always get the same system metadata. That is, I get only the following keys in @metadata: </p>
  
  <p><strong>Folder</strong></p>
  
  <pre><code>statuscode
  effectiveUri
  headers
     x-amz-id-2
     x-amz-request-id
     date
     x-amz-bucket-region
     content-type
     transfer-encoding
     server
  </code></pre>
  
  <p><strong>Objects</strong></p>
  
  <pre><code>Key
  LastModified
     date
     timezone_type
     timezone
  ETag
  Size
  StorageClass
  </code></pre>
  
  <p>However, to achieve this in other languages, a simple method call is involved.</p>
  
  <p><a href="http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/com/amazonaws/services/s3/model/ObjectMetadata.html#getUserMetadata%28%29" rel="nofollow">Get User Metadata in Android SDK</a></p>
  
  <p><a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/ObjectMetadata.html#getUserMetadata%28%29" rel="nofollow">Get User Metadata in Java SDK</a></p>
  
  <p>How do I go about accomplishing the same task in the PHP SDK?</p>
  
  <p>Any help would be greatly appreciated :)</p>