ASP MVC3 FileResult with accents + IE8 - bugged?

前端 未结 2 1287
谎友^
谎友^ 2021-01-05 21:47

If the file name contains accents, it works as expected in Opera, FF, Chrome and IE9.

But in IE8 file type is \"unknown file type\", and shows \"file\" as the file n

相关标签:
2条回答
  • 2021-01-05 22:19

    Is this a file the user is uploading to your system at some point? If so, restrict the use of accents in a file name. If not - don't use accents in your file names :).

    0 讨论(0)
  • 2021-01-05 22:41

    Try adding the following line inside your controller action:

    Response.HeaderEncoding = Encoding.GetEncoding("iso-8859-1");
    

    You may take a look at the following blog post which discusses those issues. Unfortunately there isn't a general solution which will work among all browsers.

    0 讨论(0)
提交回复
热议问题