I am using (Java Server Faces 2.2) Primefaces 3.2 simple file upload controller. I need to access file info before upload. What listener can I use when a file is selected & how do i get file info in the ManagedBean before initiating the upload
I am using (Java Server Faces 2.2) Primefaces 3.2 simple file upload controller. I
Share
The tag does not support any ajax behavior event, so the only thing you can do is to call a method before the upload starts using the “onstart” attribute of that fires when upload starts.
Using a remote command you can do something like:
add call to remote command to the fileUpload
and in the bean add a method like this
About file name you can retrieve it only when the file is being uploaded
because there is no ajax interaction possible between the component and the server before this.
So I’m sorry but is not possible.
By the way you could try to manage this through jQuery catching the event with something like