<action name="upload" class="action.MulUpload">
<!-- 设置文件的类型 -->
<interceptor-ref name="fileUpload">
<param name="allowedTypes">image/JPEG,image/JPG</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"/><result name="input">/mulFile.jsp</result>
<result name="success">/success.jsp</result>
</action>irefox与IE的区别(不加以区分的话,可能会上传失败)
1. firefox: image/jpeg image/bmp image/gif image/png
2.IE: image/pjpeg image/bmp image/gif image/x-png
struts2的配置文件中的<param
name="allowedTypes"></param>
时间: 2024-10-27 11:37:40