How Do I Preview Objects in OBS in a Browser Online?
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.
Troubleshooting
Use a user-defined domain name to preview objects.
![](https://support.huaweicloud.com/eu/obs_faq/public_sys-resources/note_3.0-en-us.png)
If you have bound a user-defined domain name to a bucket and enabled CDN acceleration, but the objects are still directly downloaded without object preview, handle the problem by referring to With CDN Acceleration Enabled, Why Are the Objects in My OBS Bucket Directly Downloaded When I Access Them?
Solution: Use a User-Defined Domain Name
![](https://support.huaweicloud.com/eu/obs_faq/public_sys-resources/note_3.0-en-us.png)
Solution advantages and restrictions
- The bucket policy must be public read, so that all objects in the bucket can be accessed by anonymous users.
- Only HTTP requests are supported.
Procedure
- Bind a user-defined domain name to the OBS bucket.
For details, see Configuring a User-Defined Domain Name. During the configuration, add a CNAME record for the OBS bucket domain name.
- Check whether objects can be previewed in a browser online.
Share an object link formatted in http://User-defined domain name/Object access path with other users for them to preview the object.
If the object still cannot be previewed, check whether the value of the object metadata ContentType is supported by the browser.
For example, ContentType should be set to video/mp4 for an MP4 video or set to image/jpeg for a JPG image. For details about all supported ContentType values, see Object Metadata Content-Type.
You can configure ContentType on OBS Console, or using APIs and SDKs.
Buckets and Objects FAQs
- Why Am I Unable to Create a Bucket?
- Why Am I Unable to Upload an Object?
- Why Am I Unable to Download an Object?
- Why Can't I Delete a Bucket?
- Why Can't I Delete an Object?
- What Is the Relationship Between Bucket Storage Classes and Object Storage Classes?
- Can I Rename an Object?
- Can I Modify the Region of a Bucket?
- Can I Edit Objects in OBS Online?
- How Do I Obtain the Access Path to an Object?
- Why Can't I Search for Certain Objects in My Bucket?
- How Do I Preview Objects in OBS in a Browser Online?
- What Should I Do If an Error Message Is Displayed When I Use Internet Explorer to Access an Object URL That Contains Chinese Characters?
- With CDN Acceleration Enabled, Why Are the Objects in My OBS Bucket Directly Downloaded When I Access Them?
- Why Is an Error Reported Even If CORS Has Been Configured?
- How Do I Batch Delete a Large Number of Objects from a Bucket or Empty a Bucket?
- How Do I Change the Enterprise Project Where My Bucket Belongs?
- How Do I Upload Objects Larger Than 5 GB?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more