Problem description
When you use an OSS acceleration endpoint to access an object from a browser, the browser downloads the object instead of displaying it inline.
Causes
This behavior affects buckets for which transfer acceleration was enabled after 00:00:00 on January 16, 2021. When you access an object in one of these buckets through an acceleration endpoint, OSS includes the following two headers in the response:
x-oss-force-download: true
Content-Disposition: attachmentContent-Disposition: attachment tells standard browsers to save the object as a file rather than render it inline.
Examples
To confirm that these headers are triggering the download, open your browser's developer tools, go to the Network tab, and inspect the response headers for the object request.
A response that triggers the download looks like this:
GET /test HTTP/1.1
HTTP/1.1 200 OK
Content-Disposition: attachment
x-oss-force-download: trueIf both headers appear, proceed to the solution below.
Solutions
Access the object through a custom domain name instead of the acceleration endpoint. For instructions on mapping a custom domain name to your bucket, see Map custom domain names.