title: The current request is not multipart request
body: <blockquote>
    <p>Below is my code:
    jsp code</p>
  </blockquote>
  
  <pre><code>&lt;form:form name="uploadForm" id="fileUploadForm" method="POST" enctype="multipart/form-data"&gt;
      &lt;input type="file" id="file" name="file" value="Import"  "&gt;
      &lt;input type = "hidden" name="strategy" /&gt;
      &lt;input type="button" value="Import" id="Import" /&gt; 
  &lt;/form:form&gt;
  </code></pre>
  
  <blockquote>
    <p>Below jquery snippet binds the click function of the Import button</p>
  </blockquote>
  
  <pre><code>$("#Import").click(function(){
      filePath = document.getElementById("file").value;
  }
  </code></pre>
  
  <blockquote>
    <p>The filePath value is getting assigned in the above variable filePath
     Below piece of code makes an Ajax call to the controller</p>
  </blockquote>
  
  <pre><code>var formData = new FormData($('#fileUploadForm')[0]);
  formData.append('tax_file', $('input[type=file]')[0].files[0]); 
  $.ajax({
      url: 'ajax/getuploadFile.html',
      data: {
          formData:formData, strategy:strategy,
      },
      type: "POST",
      contentType: false,
      processData: false,
      success : function(response){
          alert(response); 
      },
      error: function() {
          alert("Inside"); 
      }
  });
  </code></pre>
  
  <blockquote>
    <p>java controller class</p>
  </blockquote>
  
  <pre><code>@RequestMapping(value = "ajax/getuploadFile.html", method = RequestMethod.POST)
  public @ResponseBody String getuploadFile(HttpServletRequest request,
                  @RequestParam("formData") MultipartFile attachment, 
                  @RequestParam("strategy") String strategy,
                  ) throws Exception {
  </code></pre>
  
  <blockquote>
    <p>Can anyone please help me.. I am facing the exception that current request is not multipart request. We are trying to import .csv file through import functionality mentioned in jsp code.</p>
  </blockquote>