My application generates XLSX files based on a users require开发者_高级运维ments.
After the XLSX file is generated the user is redirected to where the file is saved using Response.Redirect...
Response.Redirect("filename.xlsx")
When the user then opens the file... they recieve this message.
The file you are trying to open, 'filename.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
As a temporary fix I've instructed my users to press "Yes" when they receive this message and the file opens perfectly fine.
Does anyone have any ideas why IE6 is trying to open an XLSX file as an XLS?
Note: I have a similar application that generates PPTX files in the same manner - and these open without a problem.
I've found that it is an issue with older versions of windows server.
Both the xlsx MIME type needs to be added and there are also a couple driver updates that need to be installed (I don't know specifically which ones. Our IT department is taking care of it)
To add the MIME type: Go to IIS Manager and add the .xlsx MIME type. (Documentation).
The MIME type that needs to be added is:
- File Extension: .xlsx
- MIME Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Further information on this can be found here: http://technet.microsoft.com/en-us/library/ee309278(office.12).aspx
I think, you cannot solve that problem by hosting or etc. it depend on your computer...
Here is the fix from Microsoft website ;
To configure Internet Explorer to open Office files in the appropriate Office program by using the Folder Options tool:
- Open My Computer.
- On the Tools menu (or the View menu), click Folder Options (or click Options).
- Click the File Types tab.
- In the Registered file types list, click the specific Office document type (for example, Microsoft Excel Worksheet), and then click Advanced (or click Edit).
- In the Edit File Type dialog box, click to clear the Browse in same window check box (or click to clear the Open Web documents in place check box).
- Click OK.
Here is the link http://support.microsoft.com/?scid=kb%3Ben-us%3B162059&x=13&y=13
精彩评论