Response.BinaryWrite - incorrect name of file opened on client side

Joined
Feb 3, 2010
Messages
1
Reaction score
0
Code:
                    Response.Buffer = true;
                    Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", documentFileName ));
                    Response.ContentType = documentFoundContentType;
                    Response.ContentEncoding  =  System.Text .Encoding .UTF8  ;
                    Response.HeaderEncoding = System.Text .Encoding .UTF8  ;
                    Response.BinaryWrite(ms.ToArray());

The dilaogbox that offers me saving the file shows incorrect chars if documentFileName has name not in ASCII format. What I'm supposed to do to have the file name displayed correctly in this dialogbox and to have this file opened under the same name in MS Word, Excel whatever else?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top