转自:http://mmz06.blog.163.com/blog/static/1214169620106195829950/

错误信息如下:

Content-Type not allowed: pic "upload__29a248bd_1298df50ce0__8000_00000008.tmp" image/pjpeg

struts.xml配置信息如下:

<action name="addMenu" class="minMenuAction" method="addMenu">

            <interceptor-ref name="fileUpload">

                <paramname="allowedTypes">image/bmp,image/png,image/gif,image/jpeg,image/jpg</param>

                <param name="maximumSize">1024000</param>

            </interceptor-ref>

            <interceptor-ref name="defaultStack"></interceptor-ref>

            <param name="savePath">/upfile/images</param>

            <result name="input">/page/back/category_list.jsp</result>

            <result type="redirect-action">showMenu</result>

</action>

原因:ie和chrome会把 jpgjpeg翻译成image/pjpegpng翻译成image/x-png 而火狐则很标准:jpgjpeg翻译成image/jpegpng翻译成image/png

解决方法:

<param name="allowedTypes">

     image/bmp,image/png,image/gif,image/jpeg,image/jpg,image/x-png, image/pjpeg

 </param>

posted on 2012-10-23 22:55  Iridescent'  阅读(597)  评论(0编辑  收藏  举报