Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 - x-amz-meta

I'm uploading photos, via PHP, to an Amazon S3 bucket. Everything is working great so far.

My question is about x-amz-meta. Would I use x-amz-meta key/value pairs to store data like the User ID of the person uploading and their account type (free, premium, etc.)? Or do I store this as regular metadata, not prefixed with x-amz-meta?

Currently sample metadata for a photo looks like:

Key: x-amz-meta-user-id      Value: 1
Key: x-amz-meta-user-type    Value: free
Key: Content-Type            Value: image/jpeg

Does that make sense? I hope so. Just checking I'm storing this metadata in the right way.

Thanks!

Jack

like image 554
Jack Avatar asked Aug 27 '10 11:08

Jack


People also ask

What is S3 meta?

System-defined object metadata. For each object stored in a bucket, Amazon S3 maintains a set of system metadata. Amazon S3 processes this system metadata as needed. For example, Amazon S3 maintains object creation date and size metadata and uses this information as part of object management.

What does S3 Headobject return?

The HEAD action retrieves metadata from an object without returning the object itself. This action is useful if you're only interested in an object's metadata.

What is the maximum size of S3 object metadata?

The total volume of data and number of objects you can store are unlimited. Individual Amazon S3 objects can range in size from a minimum of 0 bytes to a maximum of 5 TB. The largest object that can be uploaded in a single PUT is 5 GB.

How do I add meta data to my Galaxy S3?

Navigate to your Amazon S3 bucket or folder, and select the check box to the left of the names of the objects with metadata you want to edit. On the Actions menu, choose Edit actions, and choose Edit metadata. Review the objects listed, and choose Add metadata.


1 Answers

Custom metadata values must use the x-amz-meta- prefix, like your examples:

Key: x-amz-meta-user-id      Value: 1
Key: x-amz-meta-user-type    Value: free
like image 119
Paul K Avatar answered Sep 18 '22 19:09

Paul K