这个其实是在webxml文件中配置mime下载文件类型就可以了配置的示例
<mimemapping>
<extension>doc</extension>
<mimetype>application/msword</mimetype>
</mimemapping>
<mimemapping>
<extension>xls</extension>
<mimetype>application/msexcel</mimetype>
</mimemapping>
<mimemapping>
<extension>pdf</extension>
<mimetype>application/pdf</mimetype>
</mimemapping>
<mimemapping>
<extension>zip</extension>
<mimetype>application/zip</mimetype>
</mimemapping>
<mimemapping>
<extension>rar</extension>
<mimetype>application/rar</mimetype>
</mimemapping>
<mimemapping>
<extension>txt</extension>
<mimetype>application/txt</mimetype>
</mimemapping>
<mimemapping>
<extension>chm</extension>
<mimetype>application/mshelp</mimetype>
</mimemapping>
这样就可以防止在浏览器是直接打开文件而是弹出下载框供用户下载了