All Products
Search
Document Center

Object Storage Service:Browser downloads objects instead of previewing them

Last Updated:Mar 01, 2026

When you access an Object Storage Service (OSS) object through a browser using an OSS domain name, the browser downloads the object instead of displaying it inline. This includes access through acceleration endpoints.

Cause

For OSS activated after 00:00:00 on October 9, 2022, OSS adds the following headers to responses when HTML objects are accessed through OSS domain names:

x-oss-force-download: true
Content-Disposition: attachment

The Content-Disposition: attachment header instructs the browser to download the object as a file rather than render it inline.

This behavior does not apply to OSS activated before 00:00:00 on October 9, 2022.

Example request and response:

GET /test.html HTTP/1.1
Host: examplebucket.oss-ap-southeast-1.aliyuncs.com

HTTP/1.1 200 OK
Content-Disposition: attachment
x-oss-force-download: true

Solution

If you do not want OSS to return a header that triggers the download operation, use a custom domain name to access the object.

For setup instructions, see Map custom domain names.

Verify the fix

After you map a custom domain name, open an object URL that uses the custom domain name in your browser and check whether the object renders inline. You can also check the response headers in your browser developer tools to verify whether the Content-Disposition: attachment header is present.

FAQ

Does this affect API or SDK access?

No. The Content-Disposition: attachment header only affects how browsers handle the response. API and SDK calls retrieve the object data regardless of this header.

References