tomcat中下载RAR、excel等格式的附件乱码问题

修改TOMCAT的配置文件,TOMCAT\conf\web.xml

<mime-mapping>
    <extension>doc</extension>
    <mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>xls</extension>
    <mime-type>application/msexcel</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>pdf</extension>
    <mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>zip</extension>
    <mime-type>application/zip</mime-type>
</mime-mapping>
<mime-mapping>
   <extension>rar</extension>
   <mime-type>application/rar</mime-type>
</mime-mapping>
<mime-mapping>
   <extension>txt</extension>
   <mime-type>application/txt</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>chm</extension>
    <mime-type>application/mshelp</mime-type>
</mime-mapping>

清空IE临时文件,保存并重启TOMCAT

你可能感兴趣的:(tomcat)