af:form是包装了input type="file"的控件,所以 人为修改的东西很少,只能去设置修改参数。
<af:form usesUpload="true">
<af:inputFile label="Upload:" value="#{managedBean.file}"/><af:commandButton text="Begin" action="#{managedBean.doUpload}"/>
</af:form>
,所以在上面中添加usesUpload="true"就可以解决问题了。