jsf - primefaces fileupload invalid file type doc, docx -


i want upload doc or docx file using primefaces fileupload,although specify type of file display invalid file type

enter image description here

<p:fileupload cancellabel="#{contenu.annuler}"     fileuploadlistener="#{utiladminbean.fileupload}"     allowtypes="/(\.|\/)(doc|docx)$/"     multiple="false" mode="advanced" sizelimit="52428800"     showbuttons="false" /> 

i found solution,i forgot add fileupload component inside <h:form nctype="multipart/form-data">

functional code follows:

<h:form id="formcontract" enctype="multipart/form-data" dir="rtl">     <p:fileupload cancellabel="#{contenu.annuler}"         fileuploadlistener="#{utiladminbean.fileupload}"         allowtypes="/(\.|\/)(doc|docx|xls|xlsx|pdf)$/"         multiple="false" mode="advanced" sizelimit="52428800"         showbuttons="false" /> </h:form> 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -