Set Title of Inline File?

前端 未结 2 1827
花落未央
花落未央 2021-01-18 10:05

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 tit

2条回答
  •  滥情空心
    2021-01-18 10:28

    It is possible, just make the end of your URL to contain the filename, be sure to URLEncode it, most browsers will ignore the queryString

    localhost:3000/blah/blah/blah/Attachment%3A%20Screen%20Shot.png/?id=1670674338147205293

    Tab Display = "Attachment: Screen Shot.png"

    Works fine on Chrome, Firefox, and Opera . . . Safari displays either the domain or the entire URL depending on your settings

提交回复
热议问题