2008年6月20日
在Struts2的文件上传过滤时,设置如下: <!-- 通过动态设置allowTypes的属性来动态指定允许上传的文件类型 --> <param name="allowTypes">image/bmp,image/png,image/gif,image/jpeg</param> 我在实际运行时发现,在这种情况下上传一个jpg图片仍然会出现类型错误,后来在网上查了一下,image/jpeg格式Struts2认成是image/pjpeg,设置成这个样子,jpg图片就可以上传了。
posted @ 2008-06-20 22:26 Gone with the Wind 阅读(327) | 评论 (0) | 编辑 收藏
Powered by: BlogJava Copyright © Gone with the Wind