在学习Springmvc文件的上传与下载时,并不缺少commons-fileupload的依赖,并且lib文件夹中也已经导入了该依赖,可是仍出现了问题!?
commons-fileupload的依赖:
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
lib下的:
百度发现是因为commons-fileupload jar包版本的问题。从1.0升到1.1时,DeferredFileOutputStream.class被移除了。现在只需添加commons-io jar包即可,这个jar包中包含上面的那个类,引入以后,一切运行正常。
commons-io:
链接:https://pan.baidu.com/s/1ICxQZBX3MtKk-b3lZ1ufgw 提取码:h84j