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 displaying it.
Causes
For buckets created after 15:00:00 on September 30, 2019, OSS adds the following headers to responses when objects with image content types are accessed via the standard domain name:
x-oss-force-download: true
Content-Disposition: attachmentThe Content-Disposition: attachment header tells the browser to download the file rather than render it inline.
This behavior applies to objects with the following content types:
image/jpegimage/gifimage/tiffimage/pngimage/webpimage/svg+xmlimage/bmpimage/x-ms-bmpimage/x-cmu-rasterimage/exrimage/x-iconimage/heic
Examples
A bucket created after 15:00:00 on September 30, 2019, contains apple.jpeg with content type image/jpeg. Accessing this object via the standard domain name returns:
GET /apple.jpeg HTTP/1.1
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Disposition: attachment
x-oss-force-download: trueThe Content-Disposition: attachment header causes the browser to download the file instead of previewing it.
Solutions
To enable browser-based inline preview, bind a custom domain name to your bucket and access the object via that domain.
For setup instructions, see Map custom domain names.