1 Reply Latest reply on Mar 5, 2014 3:33 AM by Michal Petrov

    Why I cant upload a file using richfaces.

    Panagiotis Balafoutis Newbie

      Hi I try to upload a file using richfaces 4.3.3 with jsf 2.1.7 .I use as application server glassfish 3.3 in windows xp.Before of that I test the http://localhost:8080/inputs-selects-demo-1.0-SNAPSHOT/fileUpload.jsf which  I took from the code of the book Practical Rich Faces of  Max Katz and Ilya Shaikovsky.And I saw that when I did the test the file upload in the server in the C:/tmp folder.In jvm seetings of glassfish I created the entry -Djava.io.tmpdir=C:/tmp.So after of success upload of a file I saw the file uploaded with a random name e.x. richfaces_uploaded_file_5785958874751252667.tmp.Now I created a new project and I copy the code from the inputs-selects-demo-1.0-SNAPSHOT  specificaly the files FileUploadBean.java fileUpload.xhtml and also I put in the web.xml the corresponding params for upload the file with richfaces in the order which follows.

       

      <context-param>
        <param-name>org.richfaces.fileUpload.createTempFiles</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
        <param-value>1000000</param-value>
      </context-param>

      My problem is in my project I cant see the richfaces_uploaded_file_5785958874751252667.tmp .The system works like if the corresponding param is false.

      <context-param>
        <param-name>org.richfaces.fileUpload.createTempFiles</param-name>
        <param-value>true</param-value>

      </context-param>

      Also I have a second question.Is in the api of richfaces(framework api or components api)  a method when a called to get the information about the name of tmp file which uploaded in the system e.x item.getNatmpnamme() and returns the richfaces_uploaded_file_5785958874751252667.tmp.?  where item is from the listener method

      public void listener(FileUploadEvent event) throws Exception {

              UploadedFile item = event.getUploadedFile();

       

      Finally I attach the files

      1)FileUploadBean1.java

      2)uploadfile.xhtml

      3)faces-config.xml

      4)web.xml

      5)pom.xml

      Thanks in advance thrylos012