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!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With