Spring mvc hibernate 有个上传附件问题 请高手给我解决下

MultipartFile photo 报错 File has been moved - cannot be read again
Spring mvc 的上传附件
方法:
if(photos.getSize() != 0){
String name = photo.getOriginalFilename();
String str = name.substring(0,name.lastIndexOf("."));
int idx = name.lastIndexOf(".");
String extention= name.substring(idx);

String logoName = str + extention;
String logoPath = basePath+enclosurePath;
String rfilename = logoPath+logoName.trim();
String fileName= enclosurePath+logoName;
File file3 = new File(rfilename.trim());
if (!file3.exists()) {
file3.createNewFile();
}
photos.transferTo(file3);
activity.setPhoto(fileName);
}

上传服务器 报错 phots.tansferTo(file3)
File has been moved - cannot be read again

http://www.myexception.cn/j2ee/1804272.html

检查下你的maxInMemorySize配置属性,这个属性默认值为10240(即10K),大于这个大小的文件会放到临时目录 当你读取的时候 判断的文件的avaliable参数是false, 因为已经不在内存里了 所以会报异常 所以一般你超过10K就挂了 。
相同帖子参考:http://bbs.csdn.net/topics/250007752
这里还有个全英文描述的问题,如果你足够耐心可以看看:http://stackoverflow.com/questions/3747430/problem-with-spring-fileupload