Set Title of Inline File?

不羁的心 提交于 2019-12-19 19:40:28

问题


I'm forcing a download to be handled by the browser by setting the header Content-disposition to inline;

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.


回答1:


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"

See this post for some useful information about this header: How to encode the filename parameter of Content-Disposition header in HTTP?



来源:https://stackoverflow.com/questions/21789851/set-title-of-inline-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!