We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
访问存储在OSS中的资源时资源被强制下载
Content-Disposition
问题原因 访问存储在OSS的文件、图片等被强制下载的可能原因如下所示: 使用OSS提供的默认域名,且没有经过其他配置。 对应资源的Content-Type设置错误。Content-Type如果设置为application/octet-stream也会导致强制下载,这个是二进制的下载流。 对应资源的Content-Disposition设置错误。Content-Disposition如果设置为attachment,就是会强制下载。 CDN缓存了错误的Content-Type或者Content-Disposition。 浏览器不支持该格式资源的展示。
访问存储在OSS的文件、图片等被强制下载的可能原因如下所示:
条件问题只测试了没有域名,使用默认 OSS 提供的域名。
图片1
https://storageapi.fleek.co/andoroyur-team-bucket/metanetwork/users/metaio-storage/24jokhpxex0vg9bkcvav9xrn1.jpeg
content-type: application/octet-stream
这张图片会默认下载
图片2
https://smartsignature-img.oss-cn-hongkong.aliyuncs.com/banner/2020/02/04/a60cf0aa4ec50c39196dbf97ceddbbc8.jpg
Content-Type: image/jpeg
图片会默认打开预览
如果 修改 HTTP 头
Content-Disposition: attachment Content-Type: image/jpeg
这种情况会下载图片
这种设置会下载图片
其他情况具体需要测试
The text was updated successfully, but these errors were encountered:
现在已经不行啦。现在凡是默认域名,都会加上response就会自动加上Content-Disposition: attachment,就一点开就是下载
Sorry, something went wrong.
所以我之前测试好像是用 oss 自定义了 headers 来看测试效果
No branches or pull requests
访问存储在OSS中的资源时资源被强制下载
Content-Disposition
条件问题只测试了没有域名,使用默认 OSS 提供的域名。
图片1
https://storageapi.fleek.co/andoroyur-team-bucket/metanetwork/users/metaio-storage/24jokhpxex0vg9bkcvav9xrn1.jpeg
这张图片会默认下载
图片2
https://smartsignature-img.oss-cn-hongkong.aliyuncs.com/banner/2020/02/04/a60cf0aa4ec50c39196dbf97ceddbbc8.jpg
图片会默认打开预览
如果 修改 HTTP 头
这种情况会下载图片
这种设置会下载图片
其他情况具体需要测试
The text was updated successfully, but these errors were encountered: