PDF Handler : content-disposition filename

后端 未结 3 1947
长情又很酷
长情又很酷 2020-12-09 04:49

I am outputting a PDF file in a Web browser (IE8) HttpContext.Response.writefile(fileName) and it works great. When I try to save the file, it will give me the

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 04:53

    In case of INLINE, it seems that Internet explorer is using the last parameter in the URL to build the filename. For example if your url is http://doc.com/131231231 IE will prompt you to save the file as 131231231.pdf If you need a filename for example foo_131231231.pdf you can hack the IE by using this url: http://doc.com/foo_131231231 You may suffer to change your app a bit to expect such ugly parameter, but at the end your app will work as you expect.

提交回复
热议问题