Hi,
this is weird, I 've tried it here in a clean virtual machine, (Excel 2007, win7, ie9) and it works correctly. I am using the code:
Response.AddHeader("Content-Disposition", "attachment; filename=Test.xls");
Response.AddHeader("Content-Length", ms.Length.ToString());
Response.ContentType = "application/excel"; //octet-stream";
Response.BinaryWrite(ms.ToArray());
And it looks the filename has priority over the mime type.
If you have the line:
Response.AddHeader("Content-Disposition", "attachment; filename=Test.xls");
Then the file must be xls, an xlsx will how the warning
If you change this line to be
Response.AddHeader("Content-Disposition", "attachment; filename=Test.xlsx");
Then the file must be xlsx, and xls will show the warning.
But I haven't seen in any case an "xlt" file saved. I wonder what do you write in the "filename" part?
By the way, you can control if the file is a template or not with FlexCel by reading or writing to
xls.IsXltTemplate
property. But as said, a standard xls file with an xls filename should work fine, I haven't seen any issues here.
A semi-related note: One known issue that happened with ie is that it might rename files to be "file[2].xls" when the file exists, and file[2].xls is not a valid Excel filename. (xls filenames can't containt [ ] because it would confuse the formulas like =[file2.xls]!A1.
I am not sure if this know issue still applies in ie9 and actually I haven't seen for some time so it might be fixed, but it is the only ranaming issue I have seen. I haven't seen a file renamed to xlt.