Board index JavaServer Faces General page with multiple tags of <p:fileUpload ../> doesn't work

page with multiple tags of <p:fileUpload ../> doesn't work

Components, Ajax Framework, Utilities and More.

Posts: 9
I have page with multiple tags <p:fileUpload ..>, as below
<html xmlns="" xmlns:h="" xmlns:p="">
      <h:form enctype="multipart/form-data">
         <h:panelGrid columns="2">
            <h:outputLabel value="File1"/>
                <p:fileUpload id="file1"  fileUploadListener="#{fileuploadBean.listenFile1}" auto="true" />

            <h:outputLabel value="File2"/>
                <p:fileUpload id="file2"  fileUploadListener="#{fileuploadBean.listenFile2}" auto="true" />

            <h:outputLabel value="File3"/>
                <p:fileUpload id="file3"  fileUploadListener="#{fileuploadBean.listenFile3}" auto="true"  />

public class FileUploadBean {   
   public void listenFile1(FileUploadEvent event) {      
      System.out.println("listening for file1");      
   public void listenFile2(FileUploadEvent event) {      
      System.out.println("listening for file2");      
   public void listenFile3(FileUploadEvent event) {      
      System.out.println("listening for file3");      

Only the last one (file3) triggers an upload to the server. unable to uplaod the file through file 1 and file 2 tags above.

Not sure, what is wrong, any help in resolving this issue is greatly appreciated.

It worked in 3.0.M2.

Doesnot work in 3.0.M4 and 3.0.RC2-SNAPSHOT. Unable to test it with 3.0.RC1 because of the issue 3042

Primefaces Version: 3.0.M4, 3.0.RC2-SNAPSHOT
JSF Version: 2.0.4-b09
Server Tomcat: 6.0.29

Posts: 2
I have similar problem. I have multiple tags <p:fileUpload> with auto=true and I have to upload file beginning from the last one. Otherwise nothing happened (post request is not sent). Has anyone found a solution for this issue?

Posts: 17226
Location: Cybertron

It is not supported.

Posts: 9
It used to work in 3.0.M2, i have never migrated to 3.0.M3, but I think it works in there to. I haven't seen any documentation in the migration guide that states that this is no longer supported. To me it looks like a defect. If you have any wiki page or documentation on how it is supposed to work (fileupload.js looks like a cryptic code), that would be of great help. May be I can provide it back as a patch.

Posts: 17226
Location: Cybertron

It is not a defect, known limitation of advanced uploader, we will work on it after 3.0.

Posts: 2
Thanks for quick answer. I'll resolve it by putting each fileUpload in separate form shown in a dialog.

Posts: 4
So can't we put more than one file upload in a single Form?

Below is the similar one i posted,


Please suggest if we can overcome this in any way? Thing is I have to use two file uploads in auto mode in a single form.


Posts: 14
Location: Pune, India
Is this still not supported? I am using version 3.5 and facing the same issue when creating my file uploads using primefaces extension dynaform..
PF 3.5, 4.0-SNAPSHOPT,
PF extensions 0.6.1, 0.7, 1.0-SNAPSHOT
Mojarra (JSF 2.0, 2.1)
Apache tomcat 7.0.x,

Posts: 17226
Location: Cybertron

Same for 3.5, I plan to rewrite advanced uploader for 3.6, we'll see.

Posts: 5
It would be very "nice feature" to have this kind of information inside documentation book.

Best regards,
Another person affected.


Return to General