Maximum number of files in Fileupload Prime

I installed my FileUpload component with these parameters:

 <p:fileUpload label="Select image"  
                    mode="advanced"  
                    update="messages"  
                    fileUploadListener="#{fileUploadController.handleFileUpload}"
                    sizeLimit="1000000"   
                    fileLimit="1"
                    fileLimitMessage="Only 1 image"
                    allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/> 

  <p:growl id="messages" showDetail="true"/>  

But if I select more images, I do not receive any errors or warnings.

+3
source share
3 answers

I reproduced the same behavior, but I do not think it is intentional. You can make a small workaround if you use auto="true"because the file will be downloaded immediately. On the other hand, you can make sure that your backup bean simply processes the downloaded last file (perhaps the user first selected the wrong file and wants to use another).

fileLimit="1" mode="advanced" multiple="true" (. [1]), (. [2]).

[1] http://forum.primefaces.org/viewtopic.php?f=3&t=14194

[2] https://www.primefaces.org/docs/guide/primefaces_user_guide_6_1.pdf . 218

+3

. , update = "@this"

+2

the fileLimit attribute also does not work in my case. I tried with mode = "advanced" and multiple = "true". In my case, I want to limit the download of the file to 3. But this does not limit me to downloading more files.

+1
source

All Articles