Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces fileUpload allowTypes

allowTypes of my p:fileUpload don't work: I can upload any types of file... What is missing or what is wrong?

Here's my page code:

<p:fileUpload 
    id="fileUpload" 
    value="#{tcnBean.file}" 
    mode="simple" 
    allowTypes="/(\.|\/)(pdf|doc?x)$/" 
    sizeLimit="100000" 
    update="messages" 
    required="true" />

Thanks!

like image 643
user1729214 Avatar asked Dec 13 '25 05:12

user1729214


1 Answers

allow type and size limit attributes does not work in simple mode.you should change the mode to advanced or remove simple because the Default mode of fileupload is advanced.,also you should take care of the Compatibility of browser when using Advanced file upload because some features of rich UI requires browser that implement HTML5 to work properly

like image 191
hanan Ahmed Avatar answered Dec 15 '25 20:12

hanan Ahmed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!