- 论坛徽章:
- 0
|
在tomcat_home/conf/web.xml文件内进行配置:
<!-- ===================== Default MIME Type Mappings =================== -->
<!-- When serving static resources, Tomcat will automatically generate -->
<!-- a "Content-Type" header based on the resource's filename extension, -->
<!-- based on these mappings. Additional mappings can be added here (to -->
<!-- apply to all web applications), or in your own application's web.xml -->
<!-- deployment descriptor. -->
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>application/winrar</mime-type>
</mime-mapping>
即可,类似的还可以依次类推。 |
|