All Products
Search
Document Center

Object Storage Service:What do I do if an object cannot be previewed when I access the object

Last Updated:Nov 25, 2024

If an object cannot be previewed but is downloaded when you use a browser to access the object, you can refer to this topic to check your Object Storage Service (OSS), Alibaba Cloud CDN (CDN), and browser settings to troubleshoot the issue.

Item

Cause

Solution

OSS

You used the default domain name or an OSS-accelerated endpoint to access the object. To ensure data transmission security, when you use the default domain name or an OSS-accelerated endpoint to access an object of a specific type in a bucket that is created at a specific point in time, OSS forcibly adds the following headers to the response: x-oss-force-download: true and Content-Disposition: attachment. For example, the Content-Type header of the object is text/html or image/jpeg. When you access the object by using a browser, the browser detects that the Content-Disposition header is set to attachment. As a result, the object is downloaded. For more information about the x-oss-ec rules that are triggered when you access an object of a specific type in a bucket that is created at a specific point in time, see Appendix: x-oss-ec rules triggered for forcible download.

Use a custom domain name to access the object. Before you use a custom domain name, you must map the domain name to the bucket. For more information, see Map a custom domain name to the default domain name of a bucket.

The value of the Content-Type header does not match the actual object type. In this case, the browser cannot parse or render the object correctly and can only download the object.

Modify the value of the Content-Type header based on the object type. For more information, see How do I configure the Content-Type header?

The Content-Disposition header is set to attachment. In this case, the Content-Disposition: attachment header triggers the browser to download the object instead of displaying the object content.

Set the Content-Disposition header to inline. For more information, see Manage object metadata.

CDN

Resources cached on points of presence (POPs) are not refreshed.

Refresh resources cached on POPs. For more information, see Purge and prefetch resources.

Browser

The file format is not supported for preview by your browser. For example, your browser may not support preview of XLS, DOC, PPT, or PDF files.

Install a plug-in for your browser to support preview for specific file formats.

Appendix: x-oss-ec rules triggered for forcible download

The following table describes the x-oss-ec rules that are triggered for forcible download when you use the default domain name or an acceleration endpoint of OSS to access different types of objects.

Default OSS domain name

Effective region

Effective at

Applicable scope

Content-Type

x-oss-ec

China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), and China (Chengdu)

At or after 08:00 on September 28, 2018

Buckets created in a specific region

text/html

0048-00000001

China (Nanjing-Local Region), China (Fuzhou-Local Region), China (Wuhan-Local Region), China (Ulanqab), China (Heyuan), China (Guangzhou), US (Silicon Valley), US (Virginia), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), Thailand (Bangkok), UK (London), and UAE (Dubai)

At or after 12:00:00 on September 25, 2019

China (Hong Kong)

At or after 14:00:00 on November 25, 2019

China (Hohhot)

At or after 17:00:00 on September 23, 2019

  • image/jpeg

  • image/gif

  • image/tiff

  • image/png

  • image/webp

  • image/svg+xml

  • image/bmp

  • image/x-ms-bmp

  • image/x-cmu-raster

  • image/exr

  • image/x-icon

  • image/heic

  • text/html

0048-00000100

China (Qingdao) and China (Chengdu)

At or after 11:00:00 on September 24, 2019

0048-00000101

China (Zhangjiakou)

At or after 17:00:00 on September 24, 2019

0048-00000102

China (Shanghai) and China (Shenzhen)

At or after 17:00:00 on September 29, 2019

0048-00000103

China (Beijing)

At or after 18:00:00 on September 29, 2019

0048-00000104

China (Hangzhou) and China (Ulanqab)

At or after 15:00:00 on September 30, 2019

0048-00000105

All

At or after 00:00:00 on October 09, 2022

Users who have activated OSS

All

0048-00000113

Acceleration endpoints

Effective region

Effective at

Applicable scope

Content-Type

x-oss-ec

All

At or after 00:00:00 on December 31, 2020

Bucket for which transfer acceleration is enabled in the specified regions

text/html

0048-00000002

UAE (Dubai)

At or after 12:00:00 on January 07, 2021

All

0048-00000107

Malaysia (Kuala Lumpur), and UK (London)

At or after 18:00:00 on January 07, 2021

0048-00000108

Japan (Tokyo), Indonesia (Jakarta), and Germany (Frankfurt)

At or after 18:00:00 on January 8, 2021

0048-00000109

US (Silicon Valley), US (Virginia), and Singapore

At or after 12:00:00 on January 14, 2021

0048-00000110

China (Hong Kong)

At or after 00:00:00 on January 16, 2021

0048-00000111

South Korea (Seoul), Philippines (Manila), and Thailand (Bangkok)

At or after 00:00:00 on February 01, 2023

0048-00000112