Home > Development > PrimeFaces File Upload component hack

PrimeFaces File Upload component hack

If PrimeFaces file upload does not work, mostly the reason will be that the prependId attribute was not set to false in the h:form. After the user browses the file nothing happens and we are left wondering as there is no JavaScript error.

I have configured the PrimeFaces file upload as below in one of my UI page.


<h:form id="myform" enctype="multipart/form-data" prependId="false">
 <p:fileUpload fileUploadListener="#{userprofile.handleFileUpload}"
 allowTypes="*.jpg;*.png;*.gif;" description="User Profile Image"/>

 </h:form>
  • Share/Bookmark
Categories: Development Tags:
  1. March 27th, 2010 at 16:37 | #1

    This is fixed in 1.0.1 and 2.0.1

  1. No trackbacks yet.