IE works out what to do with a file based on the Content-Type and Content-Disposition headers. If you have correctly set both of those (as Ulf suggested earlier) it should be OK. Windows uses the registry HKEY_CLASSES_ROOT/MIME/Database/Content-Type to map the Content-Type header to an application. Windows also has a concept called MIME sniffing whereby it has an algorithm that attempts to workout the MIME type of a binary file by analysing the first
n bytes with varying degrees of success. Assuming you have correctly set the Content-Type MIME sniffing should not be playing a part, but if you are on XP SP2 or above you can disable it to make sure.
The file name doesn't matter to Excel. I can open a file names foo[1].bar[2] in Excel 2003 no problem. The square brakets stuff you see is a file name
pattern that Excel itself can generate. Are you sure the error is about the file name and not a security warning that files of a particular type cannot be opened from a particular location? There is a bug in IE6 that (for security reasons) prevents certain applications opening files in the default temp file space.