Object Storage Service (OSS) uses object metadata to describe object attributes. Object metadata includes standard HTTP headers and user metadata. You can configure HTTP headers to customize HTTP request policies, such as cache policies and policies for forced object download. You can also configure user metadata to identify the purposes or attributes of objects.
Standard HTTP headers
OSS retains standard HTTP headers for each object that is uploaded to a bucket. The following table describes the standard HTTP headers.
|Content-Type||The content type of the object. The browser determines the format and encoding type
that are used to read the object based on the content type of the object. If this
attribute is not specified, the value is generated based on the extension of the object
name. If the object name does not have an extension, the default value
|Content-Encoding||The encoding method of the object. You must set this parameter based on the encoding
type of the object. Otherwise, the browser that serves as the client may fail to parse
the encoding type of the object, or the object may fail to be downloaded. If the object
is not encoded, leave this parameter empty. Default value: identity. Valid values:
|Content-Language||The language of the object content.|
|Content-Disposition||The method used to access the object. Valid values:
Notice When you use a browser to access an object in OSS, the object is downloaded even if the Content-Disposition header is set to inline in the following scenarios:
|Cache-Control||The caching behavior for the object. Valid values:
|Expires||The absolute expiration time of the cache in Greenwich Mean Time (GMT). Example:
|Last-Modified||The time when the object is last modified.|
|Content-Length||The size of the object. Unit: byte.|
When you upload an object, you can add user metadata to identify the purposes or attributes of the object.
- You can configure multiple user metadata parameters for an object. However, the total size of the user metadata of an object cannot exceed 8 KB.
- User metadata is a set of key-value pairs. The name of a user metadata header must
x-oss-meta-last-modified:20210506, which indicates that the local file was last modified on May 6, 2021.
- When you call the GetObject operation or the HeadObject operation, the user metadata of the object is returned as HTTP headers.
The following table describes the methods that you can use to configure, query, and modify the metadata of objects.
|Console||A user-friendly and intuitive web application|
|ossbrowser||An easy-to-use graphical tool|
|ossutil||A high-performance command-line tool|
|Java SDK||SDK demos for various programming languages|