title: JSF 2.2 - fileupload does not work with Ajax. Form appears to have incorrect enctype (only via AJAX)
body: <p>Trying to implement the JSF 2.2 example I have the following code:</p>
  
  <pre><code>&lt;h:form prependId="false" enctype="multipart/form-data"&gt;
  
      &lt;!-- Now it's the AJAX file upload component --&gt;
      &lt;h:inputFile id="fileUpload" value="#{someBean.file}" &gt;
          &lt;f:ajax /&gt;
      &lt;/h:inputFile&gt;
  
      &lt;h:commandButton value="Upload" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>According to some JSF 2.2 this should work but in my case it is giving me the following error:</p>
  
  <blockquote>
    <p>the request doesn't contain a multipart/form-data or multipart/mixed
    stream, content type header is
    application/x-www-form-urlencoded;charset=UTF-8</p>
  </blockquote>
  
  <p>Looking into the request although I have set my form enctype correctly, the partial request submits:</p>
  
  <blockquote>
    <p>Content-type:application/x-www-form-urlencoded;charset=UTF-8
    Faces-Request:partial/ajax</p>
  </blockquote>
  
  <p>Note that web.xml also was modified to:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;multipart-config&gt;
          &lt;location&gt;c:\dotmp&lt;/location&gt;
          &lt;max-file-size&gt;20848820&lt;/max-file-size&gt;
          &lt;max-request-size&gt;418018841&lt;/max-request-size&gt;
          &lt;file-size-threshold&gt;1048576&lt;/file-size-threshold&gt;
      &lt;/multipart-config&gt;
  &lt;/servlet&gt;
  </code></pre>
  
  <p>I am using Mojarra 2.2.0-m15 but tried this with earlier versions as well. Does anyone know any useful info about this issue, which I assume is a bug?</p>