首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

struts2 jpg资料上传失败 Content-Type not allowed 解决方案

2013-03-26 
struts2 jpg文件上传失败 Content-Type not allowed 解决方案org.apache.struts2.interceptor.FileUploadI

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上传时一直显示进度条不消失:



原因:ie会把 jpg、jpeg翻译成image/pjpeg,png翻译成image/x-png 。而火狐则很标准:jpg、jpeg翻译成image/jpeg,png翻译成image/png。

解决方法:

Java代码
    <param?name="allowedTypes"> ????????image/bmp,image/png,image/gif,image/jpeg,image/jpg,image/x-png,?image/pjpeg ??</param> ?????

热点排行