Problem description
When you access an OSS image object through a browser using a standard domain name, the browser downloads the file instead of displaying it inline.
Causes
For buckets created after 17:00:00 on September 29, 2019, OSS automatically adds the following response headers when you access an object whose content type is one of the affected image types through a standard domain name:
x-oss-force-download: true
Content-Disposition: attachmentContent-Disposition: attachment is a standard HTTP header that tells browsers 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 17:00:00 on September 29, 2019 contains an object named apple.jpeg with content type image/jpeg. When you access this object through a standard domain name, OSS 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 displaying it.
Solutions
Map a custom domain name to your bucket. When you access the object through a custom domain name, OSS does not return the header that triggers the download operation, and the browser renders the image inline.
For setup instructions, see Map custom domain names.