All Products
Search
Document Center

Object Storage Service:0048-00000002

Last Updated:Jul 21, 2023

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 transfer acceleration was enabled for the bucket after 00:00:00 on December 31, 2020, and the acceleration endpoint is used to access an object whose name ends with htm or html or whose content type is text/html, the x-oss-force-download and Content-Disposition headers are included in the response.

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

Content-Disposition: attachment triggers a download operation instead of a preview in a standard browser.

Examples

For example, if you use the acceleration endpoint in a browser to access an object named index.html in a bucket for which transfer acceleration was enabled after 00:00:00 on December 31, 2020, 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 /index.html 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.

References