File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Upload Files with  MyFaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Upload Files with  MyFaces" Watch "Upload Files with  MyFaces" New topic

Upload Files with MyFaces

Jyothi Bhogadi
Ranch Hand

Joined: Jul 08, 2005
Posts: 47
hi ,
i am trying to do a file upload with the help of myfaces component given for same.
but i have a problem with the location of the storage of the file that is being uploaded .... i am able to upload my file successfully..... but i want to have my uploaded files placed in the location which is specified by me.
can anyone please help me with the code as to how to do this.....using myfaces upload component......
Any immediate help would be really appreciated as it is a kind of urgent...

Thanks in advance
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

There is nothing in MyFaces I know that allows you to specify this. They only specify the intermediate location in the web.xml file. Though, you can basically do the same thing. You could use a context-param and initialize a path location from there and access it via the FacesContext or you could just have a String constant that defines this location in your java code or any other config file or means.

GenRocket - Experts at Building Test Data
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
There's a reason why myFaces is open source... take advantage of it... (with compliance of the license of course)

Check out:
Jyothi Bhogadi
Ranch Hand

Joined: Jul 08, 2005
Posts: 47
thanks Gregg for the reply.
It was of really good help and served my purpose....


I agree. Here's the link:
subject: Upload Files with MyFaces
It's not a secret anymore!