I use the following code to send files from my server to the client:
Response.AppendHeader("content-disposition", "attachment; filename=" + FileName);
Response.ContentType = MimeType;
Response.WriteFile(PathToFile);
Response.End();
This works fine. Problem is, that when I download files from Internet Explorer, special characters, like the danish æ, ø and å, gets interpreted wrong. So i file with the name 'Test æ ø å file.txt' downloads as 'Test æ_ø_Ã¥ file.txt'
I´ve tried adding Byte Order Mark to the response:
byte[] BOM = { 0xEF, 0xBB, 0xBF };
Response.BinaryWrite(BOM);
And setting the charset:
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.UTF8;
But none if it helped. This seems only to be a problem in Internet Explorer.