All Products
Search
Document Center

Object Storage Service:0048-00000001

Last Updated:Jul 21, 2023

Problem description

When a standard domain name 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 a standard domain name is used to access a bucket that was created after 00:00:00 on October 1, 2017, to request 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 a standard domain name from a browser to access an object named index.html in a bucket that was created after 00:00:00 on October 1, 2017, 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