none
IE adds Square brackets while downloading file

    Question

  • Hi Support,

    I am seeing issue reported below when downloading files using IE9.

    A "[1]" is added to the end of the file extension. And then the file doesn't opens up. As it could not find the file extension. ie; filename.xls1.

    Is there a permanent solution?

    I thought this was because I already had a file with the same file name in
    my downloads folder - but the folder is empty.

    Regards,

    Rahul Sharma

    rahul.sharma1984@live.com

    Friday, January 06, 2012 8:05 AM

Answers

  • Hi Rahul,

     

    I would like to verify where you downloaded the file. Is the computer in domain?  

     

    Please download Microsoft® Windows® Malicious Software Removal Tool twice for a test. As far as I know, if you download the same file twice, the download manager will rename the second one as filename(1).extension

    http://www.microsoft.com/download/en/details.aspx?id=16

     

    Also, please reset Internet Explorer and test the issue in no add-on mode. Click Start -> All Programs -> Accessories -> System Tools -> Internet Explorer (with no add-ons).


    Niki Han

    TechNet Community Support

    Tuesday, January 10, 2012 9:11 AM
    Moderator

All replies

  • I ran into the same problem with a web-based app we're working on.  We recently changed our download processes to use RFC-5987 style encoding for IE9 (and the other browsers that support it).  See http://greenbytes.de/tech/tc2231/for an explanation and test cases.

    So, for example, instead of the legacy Content-Disposition:

    Content-Disposition: attachment;filename="foo.txt"

    You can now use this syntax in IE9 (and Firefox and Chrome) and support any extended characters in your download filename:

    Content-Disposition: attachment;filename="foo.txt";filename*=UTF-8''foo.txt

    What I've discovered is that if you encode the period character (.) as %2E, IE does this funky behavior and adds on the square brackets. The code they have to look for file extensions is probably not smart enough to deal with encoding of the period.  Strictly speaking, IE shouldn't have to look for encoded periods because RFC 5987 (http://tools.ietf.org/html/rfc5987) says periods are safe and don't need to be encoded.  However, in this type of situation it is best practice to allow "safe" characters to be encoded too without ill effects.

    So, it looks like an IE bug to me.  If you have access to the server/app in question, it may be possible to fix it so it isn't encoding periods in the Content-Disposition header.  That's how I avoided the bug.

     

    Regards,

    Ben Gilbert

    Monday, January 09, 2012 5:18 PM
  • Hi Rahul,

     

    I would like to verify where you downloaded the file. Is the computer in domain?  

     

    Please download Microsoft® Windows® Malicious Software Removal Tool twice for a test. As far as I know, if you download the same file twice, the download manager will rename the second one as filename(1).extension

    http://www.microsoft.com/download/en/details.aspx?id=16

     

    Also, please reset Internet Explorer and test the issue in no add-on mode. Click Start -> All Programs -> Accessories -> System Tools -> Internet Explorer (with no add-ons).


    Niki Han

    TechNet Community Support

    Tuesday, January 10, 2012 9:11 AM
    Moderator