选择多个文件在​​ASP.NET中上传(preferably不使用闪光灯) [英] select multiple files to upload in ASP.NET (preferably without flash)

查看:104
本文介绍了选择多个文件在​​ASP.NET中上传(preferably不使用闪光灯)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种解决方案,允许从文件打开的对话​​框中选择多个文件,并将其上传从ASP.NET网页?我已经经历了与此相关的previous的帖子了,但想知道是否可以选择上传多个文件,而无需使用类似Flash或Silverlight的技术?先谢谢了。

is there a solution that allows to select multiple files from the file open dialog box and upload them from ASP.NET web page? I have gone through previous posts related to this, but wondering if it is possible to select multiple files for upload without using the technologies like flash or silverlight? thanks in advance.

更新:要清楚,我需要在对话框中的文件夹中选择多个文件一次,由pressing转移或控制键。闪光灯上传控件允许这样做,但我在寻找一个没有闪光灯。看起来这是一个限制,不使用闪光灯或ActiveX控件不可能的。

UPDATE: to be clear, I need to select multiple files in a folder in the dialog box at once, by pressing shift or control key. the flash upload controls allow this, but I am looking for one without flash. it looks like this is a limitation and not possible without using flash or activex controls.

推荐答案

这是可能的HTML5这给标准输入标签的文件附加属性:多个

It's possible with HTML5 which gives the standard input tag for files an additional attribute: multiple.

在实施,它看起来像这样:

When implemented, it looks like this:

<input type="file" id="input" multiple="true" />

......,给你你在寻找什么。

...and give you exactly what you're looking for.

如果你在一些香草的Javascript折腾,你甚至可以流的文件(S)的上传

If you toss in some vanilla Javascript, you can even stream the upload of the file(s).

的http://博客。 new-bamboo.co.uk/2010/7/30/html5-powered-ajax-file-uploads

2.缺点是:


  1. 这仅适用于那些尊重HTML5(FF /铬/歌剧/ Safari浏览器)的浏览器。您还需要针对IE的口味的解决方案。

  2. 所示的例子说明如何处理在PHP /红宝石/ Django的环境流式文件。你必须弄清楚如何读取上传的文件处理这个在.NET的方式。

我希望这有助于或至少让你在正确的道路上。

I hope this helps or at least puts you on the right path.

这篇关于选择多个文件在​​ASP.NET中上传(preferably不使用闪光灯)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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