I'm trying to make the example of this link: https://github.com/spring-guides/gs-uploading-files work with Apcahe commons-fileupload
but the error: Required MultipartFile parameter 'file' is not present
is occurring.
The configuration that I'm making on the example is:
1 - Adding the dependency of commons-fileupload
in the pom.xml
:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
2 - Config the multipartResolver()
in the Application.java
@Bean
public MultipartResolver multipartResolver() {
return new CommonsMultipartResolver();
}
Without this configuration everything works fine as Spring is using org.springframework.web.multipart.support.StandardServletMultipartResolver
for handle uploads, but I want use commons-fileupload
.
There is something that I'm missing?
Thanks.
@avaz
You should disable
MultipartAutoConfiguration
like this below:Please see the DOC