title: Multi-part form not working
body: <p>I am getting a strange behavior for multi-part form. I have a simple HTML multi-part form and I am using Apache commons library to extract the fields and files. However, for some reason the servlet code ServletFileUpload.isMultipartContent(request) is returning false. Below are the HTML and Servlet code. Can someone please let me know where am I going wrong?</p>
  
  <p>This is the HTML file code.</p>
  
  <pre><code>&lt;body&gt;
      &lt;form method="post" action="http://localhost:8080/myapp/handler" enctype="multi-part/form-data"&gt;
          &lt;input type="text" name="exp_name"&gt; 
          &lt;input type="file" name="exp_image_upload_0"&gt; 
          &lt;br /&gt;
          &lt;button type="submit"&gt;Submit&lt;/button&gt;
          &lt;button class="btn"&gt;Cancel&lt;/button&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This is the Servlet Code</p>
  
  <pre><code>/** Common method called by doGet and doPost methods **/
  private void executeRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
      boolean isMultiPart = ServletFileUpload.isMultipartContent(request);
      System.out.println("Content Type : " + request.getContentType());
      System.out.println("Name : " + request.getParameter("exp_name"));
      if (isMultiPart)
          System.out.println("&gt;&gt;&gt;&gt; IS MULTIPART");
      else
          System.out.println("&gt;&gt;&gt;&gt; IS NOT MULTIPART");
  }
  </code></pre>
  
  <p>For this code, I am always getting "IS NOT MULTIPART" printed. I am sure there is something I am missing or doing wrong, but am not able to identify exactly what? Help please.</p>