org.springframework.web.multipart.MultipartException: The current request is not a multipart request

Check whether you have added CommonsMultipartResolver in Spring-Servlet.xml.

    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>

Then,
add the enctype to multipart/form-data in your form

<form id="fileupload" method="post" enctype="multipart/form-data">

Finally in Controller,
Request > MultipartHttpServletRequest

 @RequestMapping(value = "/profileimageupload", method = RequestMethod.POST)
public ModelAndView uploadProfileImage(MultipartHttpServletRequest request) {}

Dependencies

  1. commons-fileupload.jar
  2. commons-io.jar

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)