primefaces fileupload在ie8中不起作用

时间:2014-06-26 04:18:28

标签: primefaces

问题发生在IE8中,点击上传按钮后它就会挂起,进度条不会消失,但在Firefox中运行正常。我使用的是PrimeFaces 4.0和JSF 2.0

<p:fileUpload id="getCompElementComponentId" label="Browse"                                                                                                            fileUploadListener="#{applicationAction.addUpload}"                                                                                                            
mode="advanced" dragDropSupport="false" multiple="true"
sizeLimit="52489260" fileLimit="30"                                                                                                                
allowTypes="/(\.|\/)(jpg|doc|docx|txt|xls|xlsx|pdf|gif|rtf)$/">
</p:fileUpload>

谢谢,感谢任何帮助

1 个答案:

答案 0 :(得分:2)

这篇文章可以为您提供有关您的问题的一些信息 here

启用multiple=true会导致某些浏览器出现问题,IE就是其中之一。但是转换multiple=false在IE 8中完美无缺。见下面的代码

<p:fileUpload mode="advanced" multiple="false" auto="true" id="Object__Attachment__Location" 
        fileUploadListener="#{fileHandlingManagedBean.upload}" immediate="true" 
        label="Browse &amp; Upload" required="true" requiredMessage="#{dictionary['Common.AttachmentNotFound']}" 
        allowTypes="/(\.|\/)(doc|docx|xls|jpg|msg|csv|pps|ppt|xml|mng|bmp|gif|jpeg|txt|pdf|midi|wma|css|zip|rar|rtf|png)$/" 
        invalidFileMessage="Please Attach a valid file" 
        widgetVar="Object__Attachment__Location_WidgetVar" >
</p:fileUpload>

但是如果你真的需要上传多个文件,那么你需要使用自定义实现来处理它。

希望它有所帮助!

相关问题