struts2 jpg文件上传失败 Content-Type not allowed
org.apache.struts2.interceptor.FileUploadInterceptor - Content-Type not allowed: upload "upload__75549ca5_1239ddc5ce6__8000_00000161.tmp" image/pjpeg
原有配置:用ext+struts2上传时一直显示进度条不消失:
<action name="xxxAction"
class="com.web.action.xxxAction">
<interceptor-ref name="fileUpload">
<param name="allowedTypes">
image/bmp,image/png,image/gif,image/jpeg,image/jpg
</param>
<param name="maximumSize">200000000000</param>
</interceptor-ref>
<interceptor-ref name="defaultStack" />
<result>/welcome.jsp</result>
</action>
原因:ie会把 jpg、jpeg翻译成image/pjpeg,png翻译成image/x-png 。而火狐则很标准:jpg、jpeg翻译成image/jpeg,png翻译成image/png。
解决方法:
<param name="allowedTypes">
image/bmp,image/png,image/gif,image/jpeg,image/jpg,image/x-png, image/pjpeg
</param>
分享到:
相关推荐
主要介绍了php采用curl访问域名返回405 method not allowed提示的解决方法,需要的朋友可以参考下
利用struts2上传文件 环境配置JDK1.8 Eclipse 版本 Version: Mars Release (4.5.0) tomcat版本7.0.40 注意的问题是文件上传的时候的enctype="multipart/form-data" 如果设置错误会报错 今天初次使用Struts 2做文件...
从3GPP协议和UE端行为分析5G gmm cause #27的网络问题
多个struts配置文件使用,如何配置??
Android WebView 报 Not allowed to load local resource错误的解决办法 博客地址:http://blog.csdn.net/yuzhiqiang_1993/article/details/76228541
NR5G网络拒绝码-5gmm_cause = 7 (0x7) (5GS Service not allowed)
设置隐试打开PPT报错 Hiding the application window is not allowed
前端项目-jquery.allowed-chars,jQuery plugin to restrict users for typing only allowed chars for specified element
$ npm install is-retry-allowed 用法 import isRetryAllowed from 'is-retry-allowed' ; isRetryAllowed ( { code : 'ETIMEDOUT' } ) ; //=> true isRetryAllowed ( { code : 'ENOTFOUND' } ) ; //=> false ...
Host 主机名 is not allowed to connect the mysql server 原因:没有授权远程访问mysql 解决方法: cmd 中运行mysql -u root -p(如果报mysql 不是内部或外部命令,找到安装mysql对应的bin文件夹运行mysql.exe,...
通过console线重置华为交换机登录密码。输入BOOTROM的密码 盒式交换机的某些款型支持使用快捷键“Ctrl+E”进入BootROM主菜单,请根据设备的界面提示操作。 盒式交换机在V100R006C03之前的版本,BootROM默认密码为... ...
Not an allowed type ---------------------不允许使用的类型 Numeric constant too large -------------------数值常太大 Out of memory -------------------内存不够用 houjiuming Parameter ''xxx'' is never ...
2. Some of the Diskeeper installation dialogs do not display correctly on computers using the High Contrast Black display setting under the Windows Accessibility Options. Note, however, the ...
主要介绍了http请求405错误方法不被允许的解决 (Method not allowed),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
Activiti 学习笔记八:排他网关(ExclusiveGateWay)
/// 1、“has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.”。 /// 2、“has been blocked by CORS policy: No ...
"Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
NULL 博文链接:https://yizhilong28.iteye.com/blog/1137285
cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun.com/xml/ns/javaee":include-prelude, ...
struts2_上传allowedTypes_类型