title: Listener method in p:fileUpload is never invoked in primefaces
body: <p>I am trying to upload an image with primefaces and the fileUploadListener is not invoked.</p>
  
  <pre><code>&lt;h:form enctype="multipart/form-data"&gt;
  
          &lt;p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
          mode="advanced" 
          update="messages"
          sizeLimit="100000" 
          allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/&gt;
  
  &lt;p:growl id="messages" showDetail="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>here is the bean:</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public class FileUploadController {
      public void handleFileUpload(FileUploadEvent event) throws Exception {
        System.out.println("OOOOOOOOOOOOOOOOOOK");
              File targetFolder = new File("C:/Uploads");
              InputStream inputStream = event.getFile().getInputstream();
              OutputStream out = new FileOutputStream(new File(targetFolder,
                      event.getFile().getFileName()));
              int read = 0;
              byte[] bytes = new byte[1024];
  
              while ((read = inputStream.read(bytes)) != -1) {
                  out.write(bytes, 0, read);
              }
              inputStream.close();
              out.flush();
              out.close();  
  
      }
  }
  </code></pre>
  
  <p>And here is the web.xml configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  &lt;filter&gt;
  &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
  &lt;filter-class&gt;org.primefaces.webapp.filter.FileUploadFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
  &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
  &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
  &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
    &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
          &lt;param-value&gt;Development&lt;/param-value&gt;
      &lt;/context-param&gt;
      &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;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;faces/index.xhtml&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I have also added the commons-fileupload and Commons-io jars in the classpath.
  I am not understanding why the the handleFileUpload is not invoked.</p>