根据网上的方法,可以将image.transferTo(file)改为FileUtils.copyInputStreamToFile(image.getInputStream(), file); 不过其实如果出现这个问题大概率是后面代码有问题。