Content-Type not allowed ** image/x-png

struts2上传文件时严重过不去,报

Content-Type not allowed: catyIcon "application_xp_terminal.png" "upload__2c2b7695_13a557c978f__8000_00000015.tmp" image/x-png

 

经过查找发现

ie会把 jpgjpeg翻译成image/pjpegpng翻译成image/x-png

 

配置修改如下:

<!-- 上传文件过滤拦截器 -->
<interceptor-ref name="fileUpload"> 
   <param name="allowedTypes">
       <!-- IE浏览器会把 jpg、jpeg翻译成image/pjpeg,png翻译成image/x-png  -->
       image/png,image/gif,image/jpeg,image/jpg,image/bmp,image/ico,image/x-png,image/pjpeg
   </param>
   <param name="maximumSize">500000</param>
</interceptor-ref>


 

 

 

你可能感兴趣的:(Content-Type not allowed ** image/x-png)