Basic, automatic, and multiple file upload

The fileUpload component provides a file upload mechanism with enhanced features as compared to the basic HTML <input type="file"> file upload definition. The component provides an HTML5-powered UI with capabilities such as drag-and-drop, uploading multiple files, and progress tracking, and it will also support legacy browsers (for IE v6, v7, v8, and v9) for compatibility by degrading gracefully.

How to do it...

Firstly, the PrimeFaces FileUpload Filter must be defined in the web.xml file to parse incoming multipart file upload requests. It should map to the Faces Servlet definition.

<filter> <filter-name>PrimeFaces FileUpload Filter</filter-name> <filter-class> org.primefaces.webapp.filter.FileUploadFilter ...

Get PrimeFaces Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.