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
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With