By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,935 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

Problem: Content-Disposition: attachment, with non-ASCII filename

P: n/a
This is rather a IE-specific problem, but maybe someone has a solution. The HTTP headers are correct (Gecko for example understands and downloads/saves the file correctly) but IE does the wrong thing depending on the code:

sf = "Non-ASCII but valid filename.extension"
Response.AppendHeader("Content-Disposition", "attachment; filename=""" & sf & """")

proposes and saves under a UTF-8-encoded filename.

Response.AppendHeader("Content-Disposition", "attachment; filename=""" & Server.UrlPathEncode(sf) & """")

proposes a seemingly correct filename which, once saved on the disk, is UrlEncoded.

In both cases, if the filename is over a certain length, the filename is lost and IE proposes something random like CAC9QZGT.aspx. Changing the ContentEncoding/Charset of the response has no effect on the proposed filename.

Any ideas on how to solve this? I can't ask the users not to save the files using greek filenames...

I'd appreciate if you also cc any replies to my e-mail address.

TIA
Costas Andriotis

Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.