在 ASP.NET 中选择多个文件上传(最好没有 flash)

发布于 2024-09-16 00:09:56 字数 252 浏览 4 评论 0原文

有没有一种解决方案允许从文件打开对话框中选择多个文件并从 ASP.NET 网页上传它们?我已经浏览了之前与此相关的帖子,但想知道是否可以在不使用 flash 或 silverlight 等技术的情况下选择多个文件进行上传?提前致谢。

更新:要明确的是,我需要通过按 Shift 或 Control 键一次选择对话框中文件夹中的多个文件。闪存上传控件允许这样做,但我正在寻找一个没有闪存的控件。看起来这是一个限制,如果不使用 flash 或 activex 控件就不可能实现。

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的那么颓废 2024-09-23 00:09:57

HTML5 可以为文件的标准输入标签提供一个附加属性:多个。

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

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

...并为您提供您正在寻找的东西。

如果您添加一些普通的 Javascript,您甚至可以流式传输文件的上传。

http://blog.new- boy.co.uk/2010/7/30/html5-powered-ajax-file-uploads

两个缺点是:

  1. 这只适用于支持 HTML5 的浏览器(FF/Chrome/Opera/Safari)。您仍然需要适合 IE 风格的解决方案。
  2. 显示的示例指示如何在 PHP/Ruby/Django 环境中处理流文件。您必须弄清楚如何读取上传的文件并以 .Net 方式处理此问题。

我希望这对您有所帮助,或者至少让您走上正确的道路。

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.

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

http://blog.new-bamboo.co.uk/2010/7/30/html5-powered-ajax-file-uploads

The 2 downsides are:

  1. This only works with browsers that respect HTML5 (FF/Chrome/Opera/Safari). You still need a solution for flavors of IE.
  2. The example shown indicates how to deal with the streamed file in PHP/Ruby/Django environments. You'll have to figure out how to read the uploaded file deal with this in a .Net way.

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

执笔绘流年 2024-09-23 00:09:57

也许 jQuery 可以帮助你,例如 http://docs.jquery.com/Tutorials:Multiple_File_Upload_Magic

如果你 Google 一下,就会发现有很多 jQuery 上传器,不确定它们是否使用 flash,但你可以尝试一下

编辑:
http://valums.com/ajax-upload
这个允许多个文件上传

  • 在 FF、Chrome、Safari 中选择多个文件
  • 在 FF、Chrome6+ 中选择进度条 在
  • FF、Chrome 中拖放文件选择
  • 通过 CSS 上传的 Chrome 样式
  • 可取消
  • 无外部依赖
  • 不使用Flash
  • 完全支持https
  • 在FF、Chrome、Safari中
  • 键盘支持IE6-8、Firefox 3-4beta、Safari4-5、Chrome、Ope

Maybe jQuery can help you out, for example http://docs.jquery.com/Tutorials:Multiple_File_Upload_Magic

If you Google there are allot of jQuery uploaders, not sure if they use flash, but you can try it out

edit:
http://valums.com/ajax-upload
this one allowed multiple file uploads

  • multiple file select in FF, Chrome, Safari
  • progress-bar in FF, Chrome6+, Safari
  • drag-and-drop file select in FF, Chrome
  • stylable via CSS
  • uploads are cancellable
  • no external dependencies
  • doesn't use Flash
  • fully working with https
  • keyboard support in FF, Chrome, Safari
  • supports IE6-8, Firefox 3-4beta, Safari4-5, Chrome, Ope
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文