Strange characters displayed in file name - File Download Dialog - IE

Discussion in 'ASP .Net' started by Daniel Cardoso, Sep 23, 2004.

  1. I don't know what else to try - In my asp.net app, when the file name has
    Windows-1252 characters (like ã and ç), these characters appear, each one,
    as two strange characters in the file name label in Internet Explorer File
    Download Dialog that is shown when I click a link to download the file. The
    file content is being generated on-the-fly using asp.net and the filename is
    being passed using a call to Response.AddHeader with the strings
    "Content-Disposition" and "attachment; filename=" + filename.

    I want the file name to display correctly, as it DOES when I click a link in
    a test HTML file that points to a "real" file stored in the system.

    I tried setting Response.ContentEncoding but all my atempts were
    unsuccessful.
    I have also searched the net, specially google groups for an answer but I
    couldn't find.

    Thank you in advance,

    Daniel Cardoso
    Daniel Cardoso, Sep 23, 2004
    #1
    1. Advertising

  2. Afer trying a little bit more, I decided to analyze the HTTP response
    generated by the server in response to a request to download the file. I
    then realized that the special characters were being wrongly represented and
    sent to the client. I had to use Server.UrlEncode to encode the file name
    appropriately, in addition to setting Response.ContentEncoding, so that the
    special symbols were correctly sent to the browser. The problem is now
    solved.

    Regards,

    Daniel Cardoso

    "Daniel Cardoso" <> wrote in message
    news:...
    > I don't know what else to try - In my asp.net app, when the file name has
    > Windows-1252 characters (like ã and ç), these characters appear, each one,
    > as two strange characters in the file name label in Internet Explorer File
    > Download Dialog that is shown when I click a link to download the file.

    The
    > file content is being generated on-the-fly using asp.net and the filename

    is
    > being passed using a call to Response.AddHeader with the strings
    > "Content-Disposition" and "attachment; filename=" + filename.
    >
    > I want the file name to display correctly, as it DOES when I click a link

    in
    > a test HTML file that points to a "real" file stored in the system.
    >
    > I tried setting Response.ContentEncoding but all my atempts were
    > unsuccessful.
    > I have also searched the net, specially google groups for an answer but I
    > couldn't find.
    >
    > Thank you in advance,
    >
    > Daniel Cardoso
    >
    >
    Daniel Cardoso, Sep 24, 2004
    #2
    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. Kele
    Replies:
    0
    Views:
    2,780
  2. John
    Replies:
    3
    Views:
    10,476
    ifigureditout
    Jul 23, 2009
  3. Kyzer
    Replies:
    1
    Views:
    374
    Karthik Kumar
    Nov 15, 2004
  4. =?Utf-8?B?SWJyYWhpbS4=?=

    File name is displayed Garbled in "File download dialog box"

    =?Utf-8?B?SWJyYWhpbS4=?=, Aug 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    472
    =?Utf-8?B?SWJyYWhpbS4=?=
    Aug 12, 2006
  5. boney
    Replies:
    1
    Views:
    542
Loading...

Share This Page