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

Discussion in '.NET' started by senglory, Jan 24, 2011.

  1. senglory

    senglory

    Joined:
    Feb 3, 2010
    Messages:
    1
    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?
    senglory, Jan 24, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charlie@CBFC
    Replies:
    1
    Views:
    2,834
    Arlyn
    May 13, 2005
  2. ChristopherABurns@gmail.com
    Replies:
    1
    Views:
    820
    m.farbod@gmail.com
    Nov 23, 2006
  3. MichiMichi
    Replies:
    1
    Views:
    765
    MichiMichi
    Mar 1, 2007
  4. Chris  Ashley
    Replies:
    1
    Views:
    609
    bruce barker
    Oct 2, 2007
  5. Zam
    Replies:
    2
    Views:
    363
Loading...

Share This Page