设置嵌入文件的标题? [英] Set Title of Inline File?
本文介绍了设置嵌入文件的标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我强制下载由浏览器处理,方法是将 Content-disposition
设置为
I'm forcing a download to be handled by the browser by setting the header Content-disposition
to inline;
有没有这种方法设置标题?目前,它看起来像浏览器自动填充文件的URL。
Is there a way of setting the title this way? Currently it looks like the browser auto-fills it with the URL of the file.
推荐答案
是的,你可以指定文件名只是就像你为 content-disposition:attachment
所做的那样,即:
Yes, you can specify the filename just like you'd do for content-disposition: attachment
, i.e. like this:
Content-disposition: inline; filename="foo.bar"
关于这个头文件的一些有用信息,请看这篇文章:如何编码Content-Disposition标题的文件名参数在HTTP中?
See this post for some useful information about this header: How to encode the filename parameter of Content-Disposition header in HTTP?
这篇关于设置嵌入文件的标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文