I need this for the import functionality of the web-based app im creating. I need to get the path of a text file the user wants to be imported in order to egt the data inside the text file and saves it in a database.
            Asked
            
        
        
            Active
            
        
            Viewed 2,006 times
        
    2
            
            
        - 
                    http://www.primefaces.org/showcase/ui/fileUploadSingle.jsf Go for it, its very simple.... – Oct 11 '11 at 06:36
- 
                    how do import the LoggerFactory? – user958705 Oct 11 '11 at 06:49
- 
                    1Well, a simple answer is: Remove all the logger related statements, they are just used to print some debugging lines. They are not required for file upload. – Oct 11 '11 at 07:00
- 
                    You do **not** want to get the path of the file. You want go get the **contents** of the file. Read this thoroughly: http://stackoverflow.com/questions/81180/how-to-get-the-file-path-from-html-input-form-in-firefox-3/3374408#3374408 – BalusC Oct 11 '11 at 11:32
2 Answers
3
            
            
        There is no such component in standard JSF. However, there are several component libraries that offer file selection:
- PrimeFaces <p:fileUpload>
- RichFaces <rich:fileUpload>
- IceFaces <ice:inputFile>
- Tomahawk <t:inputFileUpload>
- etc. - basically every JSF component framework has such a component
 
    
    
        BalusC
        
- 1,082,665
- 372
- 3,610
- 3,555
 
    
    
        Björn Pollex
        
- 75,346
- 28
- 201
- 283
0
            
            
        You could check this out - http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf, and build yours accordingly.
 
    
    
        Saket
        
- 45,521
- 12
- 59
- 79
