• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide
  4. OBS Console Operation Guide
  5. Object Metadata
  6. Configuring Object Metadata

Configuring Object Metadata

OBS supports the configuration of object metadata.

Prerequisites

You have already been granted the read permission on objects.

Procedure

  1. In the bucket list on the OBS Console, click the target bucket to go to the Summary page.
  2. In the navigation tree on the left, click Objects.
  3. Click the arrow to the left of the object name and click Metadata.
  4. Click Add and enter the metadata information based on your needs. Figure 1 shows the Add page.

    Figure 1 Adding metadata
    OBS supports three types of metadata.
    Table 1 Supported types of metadata

    Name

    Description

    ContentDisposition

    Provides a default file name for the object that is being requested. When an object is being downloaded or accessed, the file with the default file name is directly displayed in the browser or a download dialog box is displayed if the file is being accessed.

    For example, select ContentDisposition as the metadata name and enter attachment; filename="testfile.xls" as the metadata value for an object. If you access the object through a link, a dialog box is directly displayed for downloading objects, and the object name is changed to testfile.xls. For details, see the definition about ContentDisposition in HTTP.

    ContentLanguage

    Indicates the language or languages intended for the audience. Therefore, a user can differentiate according to the user's preferred language. For details, see the definition about ContentLanguage in HTTP.

    WebsiteRedirectLocation

    Redirects an object to another object or an external URL. The redirection function is implemented using static website hosting.

    For example, you can perform the following operations to implement object redirection:

    1. Set metadata of object testobject.txt in the root directory of bucket testbucket. Select WebsiteRedirectLocation for Name and enter http://www.example.com for Value.
      NOTE:

      OBS only supports redirection for objects in the root directory of a bucket.

    2. Select testbucket. Choose Static Website Hosting > Static Website Hosting to set object testobject.txt as the default homepage of static website hosting.
    3. If you access object testobject.txt using the Endpoint on the Static Website Hosting page, the access request is redirected to http://www.example.com.

  5. Click Save.