我使用的web服务器是tomcat,在应用的web.xml(tomcat\conf\web.xml)中配置了
<mime-mapping>
  <extension>txt</extension>
  <mime-type>application/txt</mime-type>
</mime-mapping>
但ie还是直接打开而不是提示下载(对以txt类型的文件)
对于其他类型的(如:rar等)配置<mime-mapping>,ie是提示下载的。
不知道是否是配置问题还是必须通过编码才能解决:ie直接打开txt文件而不是提示下载

 

在网上仔细google了一圈, 发现还是没能解决这个问题!看样子针对txt文件还是得写个servlet来特别的处理它了!

 

相关文章:

  • 2021-07-09
  • 2021-12-02
  • 2022-12-23
  • 2021-04-15
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2021-11-08
相关资源
相似解决方案