@Bean(name = "multipartResolver")
 public CommonsMultipartResolver createMultipartResolver() {
   CommonsMultipartResolver resolver = new CommonsMultipartResolver();
   resolver.setMaxUploadSizePerFile(2048000); // 2MB	
   resolver.setMaxInMemorySize(2048000);
   resolver.setDefaultEncoding("utf-8");
   return resolver;
 }
  @Bean(name = "multipartResolver")
  public CommonsMultipartResolver getResolver() throws IOException {
    CommonsMultipartResolver resolver = new CommonsMultipartResolver();

    // Set the maximum allowed size (in bytes) for each individual file.
    resolver.setMaxUploadSizePerFile(5242880); // 5MB
    resolver.setDefaultEncoding("utf-8");

    // You may also set other available properties.

    return resolver;
  }