I am using Spring Boot version = \'1.4.0.RC1\' with Spring Boot Stormpath 1.0.2.
I am trying to use multipart file upload but the MultipartFile is always null in the con
You have to enable the Spring Multipart Resolver as by default Spring doesn't enable the multipart capability.
By default, Spring does no multipart handling, because some developers want to handle multiparts themselves. You enable Spring multipart handling by adding a multipart resolver to the web application’s context.
To your configuration class you would want to add the following bean:
@Bean
public MultipartResolver multipartResolver() {
return new StandardServletMultipartResolver();
}
Since spring boot 1.4+ uses servlet 3.0+ we can leverage on StandardServletMultipartResolver
instead of classic CommonsMultipartResolver