Help Center/ Object Storage Service/ FAQs/ Buckets and Objects/ How Do I Preview OBS Objects in My Web Browser?
Updated on 2026-08-20 GMT+08:00

How Do I Preview OBS Objects in My Web Browser?

Context

For security and compliance purposes, Huawei Cloud OBS prohibits the preview of objects in a bucket by using the default OBS domain name (a bucket domain name or static website domain name). When you use such a domain name to access objects (such as videos, images, and web pages) in a browser, no content will be displayed. Instead, the content is downloaded as an attachment.

The effective time and supported regions are as follows:

January 1, 2022: CN North-Beijing1, CN North-Beijing4, CN East-Shanghai1, CN East-Shanghai2, and CN South-Guangzhou

March 25, 2022: CN-Hong Kong, AP-Bangkok, AP-Singapore, AF-Johannesburg, LA-Mexico City1, LA-Mexico City2, LA-Sao Paulo1, AP-Jakarta, and LA-Santiago

Troubleshooting

Use a user-defined domain name to preview objects.

The following solutions are available:

Solution 1: Use a User-Defined Domain Name

Solution 2: Use a User-Defined Domain Name and CDN

Solution 3: Use Private Bucket Retrieval on CDN

Solution 1: Use a User-Defined Domain Name

When you use a browser to access a file stored in a bucket, the file preview and download behavior is determined by the HTTP response header Content-Disposition.

  • When the default domain name of a bucket is used for access, OBS forcibly adds Content-Disposition:attachment to the response header for security compliance, indicating that the object is downloaded.
  • After a user-defined domain name is bound to a bucket, OBS does not forcibly add Content-Disposition:attachment to the response header when the user-defined domain name is used to access the bucket, indicating that the object is previewed.

Solution 2: Use a User-Defined Domain Name and CDN

Solution 3: Use Private Bucket Retrieval on CDN