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

D

Daniel Cardoso

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
 
D

Daniel Cardoso

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
 

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

Top