2 Replies Latest reply on Jan 5, 2012 7:20 AM by arun.prasanth

    Problem with rich:fileUpload

      Hi,

      I am using the component rich:fileUpload and when click upload, in the console give the error:

      java.lang.IllegalArgumentException: ContentTypeList does not contain a supported content type: text/*

      My component en the page jspx is:

      <rich:fileUpload fileUploadListener="#{tareasBean.listener}"
      maxFilesQuantity="3"
      id="upload"
      immediateUpload="false"
      acceptedTypes="doc, docx, xlsx, xls"
      allowFlash="true">
      </rich:fileUpload>

      In the file web.xml:


      <filter-name>extensionsFilter</filter-name>
      <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
      <param-name>uploadMaxFileSize</param-name>
      <param-value>100m</param-value>
      </init-param>
      <init-param>
      <param-name>uploadThresholdSize</param-name>
      <param-value>100k</param-value>
      </init-param>
      <init-param>
      <param-name>createTempFiles</param-name>
      <param-value>true</param-value>
      </init-param>
      <init-param>
      <param-name>maxRequestSize</param-name>
      <param-value>1m</param-value>
      </init-param>


      In the backingbean:

      public void listener(UploadEvent event) throws Exception{
      UploadItem item = event.getUploadItem();
      FileUpLoad file = new FileUpLoad();
      file.setLength(item.getData().length);
      file.setName(item.getFileName());
      file.setData(item.getData());
      files.add(file);
      }

      but this methos never it call.

      Thanks.