如何上传jsp中的多个文件? [英] How to upload multiple files in jsp?

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

问题描述

我一直在使用input type ='file'标签上传单个文件,但是我想扩展上传多个文件的功能(在同一个对话框中选择多个文件上传)。我不知道如何完成这些,任何想法和建议?

解决方案


(在同一个对话框中选择多个文件)

无法在HTML中完成。



...除非您使用旧版本的Opera,支持这一点。 HTML文件上传字段实际上应该支持在单个字段中选择和上传多个文件,但大多数浏览器都不支持它,如果尝试了,许多Web应用程序都会失败。所以这个功能被悄悄地忽略了。

如果你绝对必须拥有这个功能(大多数用户不知道甚至可以在查找器中按住Ctrl键单击多个文件,一些解释将是必要的),你将不得不使用Flash。见例如。 SWFUpload 。不要为没有使用Flash的人提供HTML备份选项,或者讨厌使用Flash上​​传者,因为他们似乎经常使用浏览器(例如)。


I have been using "input type='file' " tag to upload single file but I want to extend the functionality to upload multiple files (selecting multiple file in the same dialog box to upload). I don't have any idea how to accomplish these, any ideas and suggestions?

解决方案

(selecting multiple files in same dialog box)

Can't be done in HTML.

...unless you use an old version of Opera, which supported this. HTML file upload fields were actually supposed to support selecting and uploading multiple files in a single field, but most browsers never supported it, and many web applications would fail if you tried. So the feature is quietly ignored.

If you absolutely must have this feature (most users don't know it's even possible to ctrl-click multiple files in a finder, so some explanation will be necessary), you will have to use Flash. See eg. SWFUpload. Do provide HTML backup options for people without Flash or who hate using Flash uploaders because they seem to stiff up the browser so often (for example).

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

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