Problem description
When an acceleration endpoint of Object Storage Service (OSS) is used to access an object from a browser, the browser downloads the object instead of providing a preview of the object.
Causes
If OSS was activated after 00:00:00 on October 9, 2022, and you use an OSS domain name to access objects, the response returned by OSS includes the x-oss-force-download and Content-Disposition headers.
x-oss-force-download: true
Content-Disposition: attachment
Content-Disposition: attachment
triggers a download operation instead of a preview in a standard browser.
This error is not returned for users that activated OSS before 00:00:00 on October 9, 2022.
Examples
For example, if you enable Object Storage Service after 00:00:00 on October 9, 2022, and use a domain name to access an object named test from a browser, the preceding two headers are included in the response. Content-Disposition: attachment
triggers a standard browser to download the object instead of providing a preview.
GET /test HTTP/1.1
HTTP/1.1 200 OK
Content-Disposition: attachment
x-oss-force-download: true
Solutions
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 more information, see Map custom domain names.