Link downloads instead of displays for Alibaba Cloud OSS Objects

351 views Asked by At

When I use an OSS endpoint to access a web file through the Internet, the Content-Disposition: 'attachment=filename;' is automatically added to the Response Header, and the web file is downloaded as an attachment. All I want to do is display my objects on public read without binding a domain. just like aws's S3

Steps taken:

  1. Create oss bucket set Basic Setting -> ACL = Public Read
  2. Set Static Pages -> Default Homepage = index.html
  3. Set Static Pages -> Default 404 Page = error.html
  4. Upload index.html & error.html into the bucket
  5. Access the bucket via https://bucket-name.oss-region.aliyuncs.com/ will download the index.html page instead of displaying the content.
  6. Access the non-existing page will show the error.html
1

There are 1 answers

0
Matthew Chin On

Please bind a domain name to the bucket. Otherwise, it wouldn't show in HTML form.

How to bind? Refer to this https://www.alibabacloud.com/help/en/object-storage-service/latest/tutorial-use-a-custom-domain-name-to-configure-static-website-hosting#section-v8z-78y-mzy