上传控件的多个文件选择 [英] Multiple file selection for an upload control

查看:118
本文介绍了上传控件的多个文件选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做这样的事情: HTTP:// WWW。 element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html



但在我的搜索信息,我发现这是不可能进行多个文件与选择简单的HTML和JavaScript(以及服务器端的JSP)。有没有办法做到这一点,而不使用Flash?第三方组件,你可以推荐吗?



感谢。


解决方案

实际上根据规范,正常的HTML文件上传字段应该是多文件上传字段。 Opera支持了一下,允许您按住Ctrl键并从文件选择器中选择多个文件。但它几乎总是打破了Web应用程序,因为许多Web框架不知道它,并会崩溃。

在此期间,通常使用JavaScript来添加一个额外的文件上传字段时前一个已填好了表单,这可制成优雅降解的非JS的UA,同时打理一下与脚本和漂亮的图标多个文件的管理。



如果您使用Flash上​​传器,最好使用简单的HTML文件上传字段进行备份,以保持兼容性。


I was trying to do something like this: http://www.element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html

But in my search for information I found that is not possible to perform multiple file selection with simple HTML and JavaScript (and JSP in the server side). There is a way to do this without using Flash? A third party component you could recommend?

Thanks.

解决方案

Actually according to the specification, normal HTML file upload fields are supposed to be multiple-file-upload fields. Opera supported it for a bit, allowing you to ctrl-click to select multiple files from a file picker. But it almost always broke the webapp since many web frameworks didn't know about it and would fall over.

In the meantime, it usually suffices to use JavaScript to add an extra file upload field to the form when the previous one has been filled in. This can be made gracefully-degrading for non-JS UAs, whilst sprucing up the management of multiple files with script and pretty icons.

If you go with a Flash uploader, it's a good idea to back it up with a simple HTML file upload field for compatibility there too.

这篇关于上传控件的多个文件选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆