0048-00000101

Updated at:

Problem description

When you use a standard Object Storage Service (OSS) domain name to access an object from a browser, the object might be downloaded instead of previewed.

Causes

This issue occurs for objects in buckets created after 11:00 on September 24, 2019. When you use an OSS domain name to access an object, OSS adds two headers to the response if the object's Content-Type is one of the following values.

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 the following two headers to the response:

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

A standard browser starts a download instead of a preview when it receives the Content-Disposition: attachment header.

Example problems

For example, when you use a browser and the standard OSS domain name to access an object named apple.jpeg with a ContentType of image/jpeg from a bucket created after 11:00 on September 24, 2019, OSS adds the two preceding headers to the response. When the browser receives the Content-Disposition: attachment header, it prompts a download instead of displaying a preview.

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

Solution

To prevent OSS from adding headers that force a download, you can access the object using a custom domain name. For more information, see Attach a custom domain name.