title: The server cannot or will not process the request due to something that is perceived to be a client error
body: <blockquote>
    <p>I am trying to upload a file using multipart</p>
  </blockquote>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>// update user details
      @RequestMapping(value = "/profile/update", method = RequestMethod.POST)
      public ModelAndView updateProfile(@ModelAttribute User user, HttpServletRequest request) {
  
          ModelAndView mv = new ModelAndView("settings");
  
          if (!user.getFile().getOriginalFilename().equals("")) {
              FileUploadUtility.uploadFile(request, user.getFile(), user.getUserCode());
          }
  
          boolean isUserUpdated = userService.isUserUpdated(user);
  
  
          if (isUserUpdated) {
              mv.addObject("message", "Succesfully Updated!");
  
              userModel = (UserModel) request.getSession().getAttribute("userModel");
              userModel.setName(user.getName());
              // some code here for successful registration//
              System.out.println("Succssful");
              return new ModelAndView("redirect:/home");
          } else {
              mv.addObject("message", "Updation Failed!");
              System.err.println("Unsuccssful");
              // some code here for unsuccessful registration//
  
              return mv;
          }
  
      }
  </code></pre>
  
  <p><strong>Jsp page</strong></p>
  
  <pre><code>&lt;sf:form class="form" action="${contextRoot}/profile/update"
                  modelAttribute="userProfile" method="POST"
                  enctype="multipart/form-data" onsubmit="return validate();"&gt;
                  &lt;!-- BEGIN BASIC ELEMENTS --&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-12"&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;div class="card" style="text-align: center;"&gt;
                                  &lt;div class="card-body "&gt;
                                      &lt;h2&gt;Avatar&lt;/h2&gt;
                                      &lt;img class="img-circle"
                                          src="${images}/${userProfile.userCode}.jpg"
                                          style="height: 150px; width: 150px;" /&gt;
                                      &lt;div class="row"&gt;
                                          &lt;div class="col-lg-12"&gt;
                                              &lt;p&gt;
                                                  &lt;span style="color: #296093; font-size: 20px;"&gt;${userProfile.name}
                                                  &lt;/span&gt; &lt;br /&gt; &lt;small style="color: #3d3d3d; font-weight: bold;"&gt;${userProfile.role}&lt;/small&gt;
                                              &lt;/p&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;div class="row"&gt;
                                          &lt;div class="col-md-8 col-md-offset-2"&gt;
                                              &lt;sf:input id="file" class="inputfile" type="file" path="file" /&gt;
                                              &lt;label for="file"&gt;&lt;span&gt;Choose a file&amp;hellip;&lt;/span&gt;&lt;/label&gt;
                                              &lt;br /&gt; &lt;span style="color: #d62424" id="file_error"&gt;&lt;/span&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!--end .col --&gt;
  </code></pre>
  
  <blockquote>
    <p><strong><code>Whenever i click on save i receive this error:</code></strong> The server cannot or
    will not process the request due to something that is perceived to be
    a client error (e.g., malformed request syntax, invalid request
    message framing, or deceptive request routing).</p>
  </blockquote>