0048-00000103

Updated at:

Problem description

When you use a browser to access a file using a standard Object Storage Service (OSS) domain name, the file might be downloaded directly instead of being previewed.

Problem cause

For buckets created after 17:00 on September 29, 2019, when you use a standard OSS domain name to access an object whose ContentType is one of the following types, OSS adds two headers to the response:

image/jpeg
image/gif
image/tiff
image/png
image/webp
image/svg+xml
image/bmp
image/x-ms-bmp
image/x-cmu-raster
image/exr
image/x-icon
image/heic

OSS adds two headers to the response:

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

In a standard browser, the Content-Disposition: attachment header triggers a download instead of a preview.

Example problems

For example, a bucket was created after 17:00 on September 29, 2019. The bucket contains an object named apple.jpeg whose ContentType is image/jpeg. When you use a standard OSS domain name to access the object from a browser, the response from OSS includes two headers. The Content-Disposition: attachment header causes the browser to download the object instead of previewing it.

GET /apple.jpeg HTTP/1.1
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Disposition: attachment
x-oss-force-download: true

Solution

If you do not want OSS to return headers that force a download, you can access the object using a custom domain name. For more information, see Map custom domain names.