gpt4 book ai didi

http - 谷歌云存储忽略内容处置 : inline

转载 作者:可可西里 更新时间:2023-11-01 17:17:26 24 4
gpt4 key购买 nike

我想向我的团队提供内部 HTML 报告,但不公开访问。所以我将 HTML 作为对象上传到 GCS 存储桶中。但是当我向人们发送对象的链接时

https://storage.cloud.google.com/our_bucket/path/to/report.html

它不渲染 HTML,而是下载它。我尝试按照指示编辑 Content-Disposition header 上的对象元数据 here .

gsutil setmeta -h 'Content-Disposition:inline' gs://our_bucket/path/to/report.html 

我已验证它在 Web 控制台中设置了值。但是,它仍然没有在 Chrome(或 Safari)中显示内联文件,它只是下载它。响应 header 也不包含 Content-Disposition:inline。它似乎保存了我的元数据,但忽略了它。 如何在不先下载到磁盘的情况下在浏览器中显示我的 HTML?

最佳答案

这是我的错误。仅仅设置 Content-Disposition:inline 是不够的。我还必须设置 Content-Type:text/html

关于http - 谷歌云存储忽略内容处置 : inline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54793388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com