I'm new in the forum and this is my first post.
I'm using the last version of PrimeFaces.
I'm trying to use p:fileupload and set the file in the backbean but it doesn't work!!
The user click on browse button and a window pop to choose a file on his computer. As soon as he chooses the file, I can see the link but it doesn't set the file in the backbean. I want to be able to copy the choosen file on the server.
I've try to do that:
Code: Select all
<h:form enctype="multipart/form-data">
<p:fileUpload value="#{documentationBean.file}" mode="simple"/>
<p:commandButton value="Submit" ajax="false" actionListener="#{documentationBean.upload}"/>
</h:form>
I've set "private UploadedFile file;" in the java bean and the getter and setter with an upload method.
Code: Select all
public void upload() {
//code
}
I hope I'm clear about what I'm trying to do.
If anybody can help, that'd be great.
Maybe you'll think about another solution, I'm completely stuck here.
Cheers