All Products
Search
Document Center

Object Storage Service:How to configure the preview behavior for files in OSS

Last Updated:Aug 15, 2025

If your browser forces a download when you access a file in OSS, check your OSS, CDN, and browser settings.

Item to check

Cause

Solution

OSS

When you use a default domain name or an acceleration endpoint to access certain types of files, such as files with a Content-Type of text/html or image/jpeg, in a bucket created after a specific time, OSS adds download headers (x-oss-force-download: true and Content-Disposition: attachment) to the response. This forces the browser to download the file instead of previewing it. For more information, see Appendix: x-oss-ec rules that trigger forced downloads.

Use a custom domain name and attach it to the bucket. For more information, see Default domain names.

The Content-Type value does not match the actual file type. The browser cannot render the file correctly and initiates a download instead.

Set an appropriate Content-Type. For more information, see How do I set the Content-Type (MIME)?.

The Content-Disposition is set to attachment. This triggers the browser to download the file.

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

CDN

The resource has not been purged from the CDN cache.

Purge the resource from the CDN cache. For more information, see Refresh and prefetch resources.

Browser

The browser does not support previewing this file format.

You can install a browser extension

Appendix: x-oss-ec rules that trigger forced downloads

The following x-oss-ec rules trigger forced downloads when you use default domain names or acceleration endpoints to access certain types of files.

OSS default domain names

The following table describes the effective periods and other information for OSS default domain names in different regions.

Effective region

Effective period

Affected object

Content-Type

x-oss-ec

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

From 08:00 on September 28, 2018

Buckets created in the specified region

text/html

0048-00000001

China (Nanjing - Local Region - Decommissioning), China (Fuzhou - Local Region - Decommissioning), 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), UAE (Dubai)

From 12:00 on September 25, 2019

China (Hong Kong)

From 14:00 on November 25, 2019

China (Hohhot)

From 17: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), China (Chengdu)

From 11:00 on September 24, 2019

0048-00000101

China (Zhangjiakou)

From 17:00 on September 24, 2019

0048-00000102

China (Shanghai), China (Shenzhen)

From 17:00 on September 29, 2019

0048-00000103

China (Beijing)

From 18:00 on September 29, 2019

0048-00000104

China (Hangzhou)

From 15:00 on September 30, 2019

0048-00000105

All regions

From 00:00 on October 09, 2022

Users who have activated OSS

All

0048-00000113

Acceleration endpoints

The following table describes the effective periods and other information for acceleration endpoints in different regions.

Effective region

Effective period

Affected object

Content-Type

x-oss-ec

All regions

From 00:00 on December 31, 2020

Buckets for which transfer acceleration is enabled in the specified region

text/html

0048-00000002

UAE (Dubai)

From 12:00 on January 07, 2021

All

0048-00000107

Malaysia (Kuala Lumpur), UK (London)

From 18:00 on January 07, 2021

0048-00000108

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

From 18:00 on January 08, 2021

0048-00000109

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

From 12:00 on January 14, 2021

0048-00000110

China (Hong Kong)

From 00:00 on January 16, 2021

0048-00000111

SAU (Riyadh - Partner Region), South Korea (Seoul), Philippines (Manila), Thailand (Bangkok)

From 00:00 on February 01, 2023

0048-00000112