WebLogic服务器环境下打开附件(.rar/.zip/.doc/.xls)出错的解决方法

如果是下载打开请在web.xml最后加上如下声明:
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/x-msexcel</mime-type>
</mime-mapping> 
<mime-mapping>
<extension>zip</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>

如果是链接打开请在web.xml最后加上如下声明:

<mime-mapping>
<extension>doc</extension>
<mime-type>text/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>text/x-msexcel</mime-type>
</mime-mapping> 
<mime-mapping>
<extension>zip</extension>
<mime-type>text/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>text/octet-stream</mime-type>
</mime-mapping>

你可能感兴趣的:(weblogic,服务器)