0048-00000113

Updated at:

Description

When you use a browser and an Object Storage Service (OSS) acceleration endpoint to access an object, the browser downloads the object instead of displaying it.

Cause

If you activated OSS after 00:00 on October 9, 2022, and use an OSS domain name to access any object, OSS adds two headers to the response:

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

A standard browser downloads the object instead of previewing it when it receives the Content-Disposition: attachment header.

Example

For example, you activate OSS after 00:00 on October 9, 2022, and create a bucket that contains an object named test.jpg. When you use a browser and an OSS domain name to access test.jpg:

GET /test.jpg HTTP/1.1

OSS adds the Content-Disposition and x-oss-force-download headers to the response.

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

When a standard browser detects Content-Disposition: attachment, it downloads the object instead of previewing it.

Solution

If you do not want OSS to return a header that triggers a download, use a custom domain name to access the object. For more information, see Attach a custom domain name.