When maintaining the website a few days ago, if the file type of the file link on the website is docx, XLSX, and other office07 files, click the link in the IE browser, and Garbled text is displayed. The doc and XLS files on the server are normal. Chrome, FF and other browsers are also displayed normally.
In my local test, opening the local docs and XLSX files through the IE link can also be displayed normally.
Later, we found that docx is in XML format, while ie opens the file after clicking the link by default. Therefore, ie uses the XML file to open the docx file, which will naturally display garbled characters.
Solution: Configure in the web. xml file of the server:
<Mime-mapping>
<Extension> docx </extension>
<Mime-type> application/MSWord </mime-type>
</Mime-mapping>
In this way, you can use the word of the office to open the docx file. The XLSX file configuration is similar.
Why is this only true for IE and why is the local test normal. I have no in-depth understanding of the specific reasons. I personally think it is different from other browsers when ie implements the HTTP protocol. In addition, the file protocol should be used to open files locally, which may not be affected by HTTP vulnerabilities.