无法让 CouchApp 为应用程序缓存输出正确的 mime 类型
因此,在 CouchDB 中,您可以更改 mime 类型。在 Futon 中,您只需编辑文档源并更改 _attachment 字段中附件的 content_type 字段即可。问题是,当我这样做以使应用程序缓存文件具有正确的 mime 类型(文本/缓存清单)并保存文档时,它不会保存,并且 content_type 字段再次变为空白“”。关于输出正确的 mime 类型有什么建议吗?
So in CouchDB, you can supposedly change mime types. In Futon you just have to go and edit the source of the document and change the content_type field on attachments in the _attachment field. Trouble is, when I do this so that an appcache file has the correct mime type (text/cache-manifest), and save the document, it doesn't save and the content_type field is just blank again "". Any tips on outputing the right mime type?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
哇,这很奇怪。
您可以通过在存储附件时添加
Content-Type: text/cache-manifest
标头来解决此问题。我认为这在浏览器中不起作用,因为它会覆盖内容类型。您可以从命令行使用curl 上传附件。您需要知道文档当前的
_rev
修订值。Wow, that is weird.
You can work-around this problem by adding a
Content-Type: text/cache-manifest
header when you store the attachment.I think this will not work from a browser because it overrides the Content-Type. You can use curl from the command-line to upload an attachment. You need to know the document's current
_rev
revision value.用户不可编辑 _attachments 对象,这解释了为什么您的更新未按预期工作。您对 _attachments 最多可以做的就是通过从对象中删除附件来完全删除附件。
The _attachments object is not user editable, which explains why your update did not work as expected. The most you can do with _attachments is to remove attachments completely by removing them from the object.