6 Replies Latest reply on Feb 23, 2011 6:14 AM by sk rajath

    Folder Path Selection not available in RichFaces

    sk rajath Newbie

      Hi, my project has a simple issue, am not able to figure it out how to solve it in Richfaces. Any one can guide me to the right way.

       

      Using RichFaces, When I upload a file, it successfully uploads. If I want to know the source location from where the file was uploaded I am getting the temporary file’s path. Is there a way to get the source path of the file being uploaded? I need to keep track of files being uploaded and their source location.

       

      My code goes like this

       

      <rich:fileUpload  id="upload1"

      fileUploadListener="#{bean.listener}"

      acceptedTypes="tar" listHeight="45px" required="true"

      ajaxSingle="true" allowFlash="false" immediateUpload="true"  maxFilesQuantity="50" >

      </rich:fileUpload>

       

      public void listener(UploadEvent event) throws Exception

            {           

                  System.out.println("file uploaded");

                  item =  event.getUploadItem();

                  f1 = item.getFile();

                  System.out.println("canonical path --->"+f1.getCanonicalPath());

                  System.out.println("Absolute path --->"+f1.getAbsolutePath());

            }

       

      OUTPUT:

      Cononocal Path --à “some temp path”

      Absolute Path --à “some temp path”

       

      Is there a way to get the source path or is there any component in Richfaces to select just a location/directory. My project next step is standing on your reply.

       

      Thanks

      S.K.Rajath