Metadata

Topics

Each Amazon S3 object has a set of key-value pairs with which it is associated. There are two kinds of metadata: system metadata, and user metadata.

System metadata is used and is sometimes processed by Amazon S3. System metadata behavior depends on which API (REST or SOAP) you are using.

User metadata entries are specified by you. Amazon S3 does not interpret this metadata—it simply stores it and passes it back when you ask for it. Metadata keys and values can be any length, but must conform to US-ASCII when using REST and UTF-8 when using SOAP or browser-based uploads through POST.

[Note]Note

For more information about metadata encodings, go to sections 2 and 4.2 of http://www.ietf.org/rfc/rfc2616.txt.

For both REST and SOAP requests to Amazon S3, user metadata size is limited to 2k bytes for the total length of all values and keys.

In REST, user metadata keys must begin with "x-amz-meta-" to distinguish them as custom HTTP headers. When this metadata is retrieved via SOAP, the x-amz-meta- prefix is removed. Similarly, metadata stored via SOAP will have x-amz-meta- added as a prefix when it is retrieved via REST or HTTP, except the Content-Type header.

When metadata is retrieved through the REST API, Amazon S3 combines headers that have the same name (ignoring case) into a comma-delimited list. If some metadata contains unprintable characters, it is not returned. Instead, the "x-amz-missing-meta" header is returned with a value of the number of the unprintable metadata entries.