Gone with the Wind

达摩祖师说:“不要太执著,一切随缘!”
posts - 0, comments - 0, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Struts2中jpg图片上传过滤

Posted on 2008-06-20 22:26 Gone with the Wind 阅读(325) 评论(0)  编辑  收藏 所属分类: Struts2

  在Struts2的文件上传过滤时,设置如下:

   <!-- 通过动态设置allowTypes的属性来动态指定允许上传的文件类型 -->
          <param name="allowTypes">image/bmp,image/png,image/gif,image/jpeg</param>

  我在实际运行时发现,在这种情况下上传一个jpg图片仍然会出现类型错误,后来在网上查了一下,image/jpeg格式Struts2认成是image/pjpeg,设置成这个样子,jpg图片就可以上传了。


只有注册用户登录后才能发表评论。


网站导航: