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

C

Costas Andriotis

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
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top