rich:fileUpload is a component which provides files upload functionality and extends functionality of standard input with type=file.
We can have different characteristics with this component like: allowed file types, maximum files quantity, and immediate upload.
It supports immediate upload as soon as a file is selected with this component.
<rich:fileUpload id="fileUploadId"
autoclear="true"
uploadListClass="uploadList"
fileEntryClass="fileEntry"
allowFlash="auto"
styleClass="richFileUpload"
fileUploadListener="#{handler.documentUpload}"
maxFilesQuantity="#{constants.FILE_UPLOADLIMIT}"
required="true"
immediate="true"
listHeight="1px"
listWidth="71px"
onupload="onFileUploadClick();"
addControlLabel="#{constants.Label_Browse}"
immediateUpload="true"
noDuplicate="true"
onadd="addFileListener(event)">
<a4j:support event="onuploadcomplete" immediate="true" reRender="hiddenVal,docTableId,uploadErrorGrid,docSelectedMsgID,exceptionMessageGrid"/>
</rich:fileUpload>