使用C#在ASP.NET 4.0环境多文件上传 [英] Multi file upload using c# on ASP.NET 4.0 environment

查看:235
本文介绍了使用C#在ASP.NET 4.0环境多文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要找上传多个文件的解决方案(点击浏览按钮,使用Shift键选择多个文件)。

I am looking for a solution to upload multiple files (click on browse button, and select multiple files using shift key).

我看到几个解决方案,需要由一个通过点击浏览按钮上传之一,并点击提交按钮。但我需要让用户在同一时间选择多个文件。

I see several solutions that need to be uploaded one by one by clicking browse button, and click submit button. But I need to allow users to select multiple files at the same time.

推荐答案

<输入类型=文件> 在很大程度上受到应有的网页浏览器锁定安全问题。它不允许选择多个文件。您将需要使用Flash或Silverlight要做到这一点,或使用多个<输入类型=文件方式> 字段

The <input type="file"> is heavily locked down by the web browser due to security concerns. It does not allow multiple file selections. You will need to use Flash or Silverlight to do this, or use multiple <input type="file"> fields.

您可以允许用户选择一个文件,然后提供一个添加另一个文件按钮,生成使用jQuery另一个文件上传输入。你将能够允许不定数量的上传这种方式,但用户必须单独浏览每个人。

You can allow the user to select one file and then provide an "Add Another File" button, which generates another file upload input using jQuery. You would be able to allow an indefinite number of uploads that way, but the user will have to browse for each of them individually.

在一个侧面说明,HTML 5将支持多文件上传,但它没有被广泛当前Web浏览器实现,因此不是一个选项。

On a side note, HTML 5 will support multiple file uploading, but it is not widely implemented in current web browsers and so is not an option.

这篇关于使用C#在ASP.NET 4.0环境多文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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