Your inputFile should look something like the following where gciuiCheckin is a reference to the backing bean. In this case the inputFile control is in a jsff contained as a region inside a jspx with usesUpload="true", but this would be similar if you are putting your controls directly in the jspx, the main thing is you need to bind the control value to a backing bean variable of type UploadedFile:
<af:inputFile label=" " id="ifDoc" columns="50"
value="#{pageFlowScope.gciuiCheckin.filesToUpload}"
maximumFiles="#{pageFlowScope.gciuiCheckin.maxFilesCanBeUploaded}"
autoHeightRows="0" rows="5" uploadType="auto"/>
Then you also should have a commandButton to call a bean method once user has selected the file (each file typically is uploaded to server as the user selects or drag drops each one):
<af:commandButton text="Commit File(s)" id="cbUpload"
partialSubmit="true" action="#{pageFlowScope.gciuiCheckin.saveUploadedFilesAction}"/>
You will need this import in the backing bean:
import org.apache.myfaces.trinidad.model.UploadedFile;
In the backing bean, create a List with accessors to hold the uploaded files:
private List<UploadedFile> filesToUpload;
In the method called by the commandButton, you will do something like:
public String saveUploadedFilesAction() {
List<UploadedFile> files = this.getFilesToUpload();
if (files == null || files.size() == 0) {
displayMessageToUser(FacesMessage.SEVERITY_WARN, checkinErrorMessage);
return null;
}
//iterate each file and check size, extension, etc...
for (int i = 0; i < files.size(); i++) {
UploadedFile currFile = files.get(i);
//now do something with the file...
}
...
Hope this helps.