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

Discussion in 'ASP .Net' started by Costas Andriotis, Oct 15, 2004.

  1. 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
     
    Costas Andriotis, Oct 15, 2004
    #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. ben
    Replies:
    0
    Views:
    1,087
  2. =?Utf-8?B?R1JF?=
    Replies:
    1
    Views:
    3,435
    Craig Deelsnyder
    Aug 20, 2004
  3. =?Utf-8?B?SmVk?=

    Content-Disposition Doesn't Set Filename in IE

    =?Utf-8?B?SmVk?=, Apr 6, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    13,531
    =?Utf-8?B?SmVk?=
    Apr 8, 2005
  4. Sergio Juan
    Replies:
    1
    Views:
    1,042
    mohammad.h.ashmawi
    Apr 29, 2011
  5. Ed
    Replies:
    10
    Views:
    46,495
    alok000707
    Jul 13, 2010
Loading...

Share This Page