How to encode the filename parameter of Content-Disposition header in HTTP?

前端 未结 18 1763
北荒
北荒 2020-11-21 06:15

Web applications that want to force a resource to be downloaded rather than directly rendered in a Web browser issue a Content-Disposition hea

18条回答
  •  日久生厌
    2020-11-21 07:16

    We had a similar problem in a web application, and ended up by reading the filename from the HTML , and setting that in the url-encoded form in a new HTML . Of course we had to remove the path like "C:\fakepath\" that is returned by some browsers.

    Of course this does not directly answer OPs question, but may be a solution for others.

提交回复
热议问题