t:inputFileUpload not uploading the file

℡╲_俬逩灬. 提交于 2019-12-01 14:46:39

It is not possible to upload files by ajax with current JSF and Tomahawk version. Ajax requests as created by JSF do not support nor use multipart/form-data. Tomahawk is not an ajax based component library. Use a normal command button instead.

<h:commandButton value="#{tpMsgs.upload}"
    styleClass="button" action="#{paramUpload.uploadParamFile}"
    onclick="javascript:updateParentScreen();">
</h:commandButton>

Support for uploading files with ajax is scheduled for upcoming JSF 2.2 with new <h:inputFile> component.

Alternatively, you can use RichFaces' own <rich:fileUpload>. Depending on the RichFaces version used, it uses either Flash or an iframe hack under the covers to achieve asynchronous file uploading.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!