Accueil > Bugzilla, Mozilla > Don’t name your file "attachment.txt" or IE8 will make you crazy

Don’t name your file "attachment.txt" or IE8 will make you crazy

While reviewing and testing a patch for Bugzilla, I spent tens of minutes looking at and playing with IE8 parameters to configure it to display text files inline, i.e. from the web browser directly. I couldn’t figure out why it was unable to display a simple text file. As Google was unhelpful, I had to figure it myself. The reason is crazy: the file I attached to Bugzilla was named "attachment.txt", and due to the word "attachment", IE8 automatically wants to download the file! If I rename the file to e.g. "file.txt" or "bazooka.txt", it works fine again and displays the text file inline, as desired. If you don’t believe me, try yourself and open the two attachments I put here on landfill.

Catégories:Bugzilla, Mozilla
  1. Tiago Sá
    3 août 2010 à 6:38  

    I’d go for the panzerschreck.txt if I were you, but it’s all good :)~

  2. Simon
    3 août 2010 à 11:03  

    Hmm… going by Reed’s link, it doesn’t need to be called attachment.txt, it merely needs to have ‘attachment’ in the filename. Careless use of regular expressions, I suppose. Well done, Microsoft.

  3. Frédéric Buclin
    3 août 2010 à 11:06  

    @Simon: yeah, I tested attachment.html too, but I didn’t want to enumerate them all. You get the idea. ;) And yes, congrats to Microsoft for being so bad at detecting the content disposition.

  4. Ian Thomas (thelem)
    4 août 2010 à 7:58  

    Reminds me of a fun attachment name bug in Outlook.

    We sell holidays, and send emails to the admin staff with attachments called "Flight.html" and "Hotel.html" which they have to open. Everything worked fine for a while, but then they reported that one computer couldn’t open the Hotel files, but the others were still working fine. Then one of the other computers couldn’t open the flight file but could still open Hotel.

    After much head scratching it turned out that the problem was outlooks temp file. It was saving our files as "Flight1.html", "Flight2.html" etc. Problem was, it would check all numbers 1 – 100, and if there were already files with all those names then it would show a confusing error message.

  5. 4 août 2010 à 8:16  

    I MUST try attachment.js , that with the stupid behavior is a perfect filter…

  1. No trackbacks yet.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:


Vous commentez à l'aide de votre compte Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s


Recevez les nouvelles publications par mail.