免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3106 | 回复: 2

如何配置tomcat使能下载扩展名是doc,rar的文件 [复制链接]

论坛徽章:
0
发表于 2005-11-16 15:48 |显示全部楼层
如题,谢谢!

论坛徽章:
0
发表于 2005-11-16 19:47 |显示全部楼层
在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>

即可,类似的还可以依次类推。

论坛徽章:
0
发表于 2005-11-17 11:56 |显示全部楼层
谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP