2 Replies Latest reply on Mar 18, 2011 6:20 PM by turocabrera

    rich:fileUpload and null data

    apashkev

      I'm trying to upload a file to the server using rich:fileUpload, the code I'm using looks like this :

       

      FileUploader.java

       

      @Name("fileUploader")
      public class FileUploader {

      private byte[] fileData;

          public void uploadFileListener(UploadEvent uploadEvent) {
              fileData = uploadEvent.getUploadItem().getData();
              //other code here
          }  
      }

       

      page contains the following :

      rich:fileUpload fileUploadListener="#{fileUploader.uploadFileListener}"

      but uploadEvent.getUploadItem().getData(); returns null... 
      I've set those parameters in web.xml as well :

      <init-param>

      <param-name>createTempFiles</param-name>

      <param-value>true</param-value>

      </init-param>

      <init-param>

      <param-name>maxRequestSize</param-name>

      <param-value>2000000</param-value>

      </init-param>


      still returns null,...

       

      Thanks!