public class FileUploadRenderer extends CoreRenderer {
public void decode(FacesContext facesContext, UIComponent component) {
FileUpload fileUpload = (FileUpload) component;
String clientId = fileUpload.getClientId(facesContext);
MultipartRequest multipartRequest = getMultiPartRequestInChain(facesContext);
if(multipartRequest != null) {
FileItem file = multipartRequest.getFileItem(clientId);
if(file != null) {
UploadedFile uploadedFile = new DefaultUploadedFile(file);
fileUpload.queueEvent(new FileUploadEvent(fileUpload, uploadedFile));
}