asp.net几种开源上传控件,flash,ajax版,支持多文件

1、AspnetUpload


地址:http://www.aspnetupload.net/

最早接触的上传控件。带进度条,能与系统自带的InputFile控件共用。不过是收费的,而且对Firefox支持较差。最新版本是2.3

 

2、FancyUpload - Swiff meets Ajax (v2.0)(开源)

地址:http://digitarald.de/project/fancyupload/

Falsh上传,Ajax技术,还不错。

 

3、SWFUpload(开源)

地址:http://swfupload.org/

利用JavaScript/Flash技术,非常成熟,跨平台,支持大多数浏览器。

 

4、这里再提供一个完整的源代码(来自CodeProject)


地址:http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

 Multiple File Upload With Progress Bar Using Flash and ASP.NET

 也可以从这里下载

邀月补充:

5、 Ajax Uploader

  ASP.NET File Upload like GMail(像Gmail那样上传文件,听名字就有点吸引人)

Ajax Uploader is an easy to use, hi-performance File Upload Control which allows you to upload files to web server without refreshing the page.

It allows you select and upload multiple files and cancel running uploads, add new files during uploading.

Ajax Uploader allows you to upload large files to a server with the low server memory consumption. The look and feel of file upload controls can be customized to seamlessly blend into your website design.

Demo | Download

 

 


6、ComponentArt UI Framework 2009.2 for .NET 的Upload组件

官方网站http://www.componentart.com/

这个就不用说了! 演示地址

http://aspnetajax.componentart.com/control-specific/upload/features/core_features/webform1.aspx

 

7.NeatUpload——支持大文件上传的控件

【推荐】.NET批量上传控件——HtmlInputFiles 一文中有博友向我推荐了NeatUpload上传控件,于是花了点时间对该控件进行了简单的学习,感觉这个控件真的不错,不但能够支持大文件上传,而且还有上传进度条,更重要的是NeatUpload控件是为数不多的支持大文件上传的免费控件,废话不说了,下面先介绍NeatUpload控件如何使用。
  NeatUpload控件下载

  一、前期准备

  1、下载neatupload的免费版本http://www.brettle.com/neatupload#Download 

  2、访问地址http://www.brettle.com/Demo.aspx查看相应的Demo示例; 

  3、将Brettle.Web.NeatUpload.dll添加到工具箱; 

  4、将\NeatUpload-1.2.32下的NeatUpoad文件夹复制到项目根目录; 

  5、在Web.configsystem.web节点中写入下面的配置 

  <httpModules>

        <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />

  </httpModules> 

  <httpRuntime maxRequestLength="400000" executionTimeout="3600" /> 

  二、NeatUpload.net中的运用

  前台代码

    <Upload:ProgressBar ID="ProgressBar1" runat="server" Inline="True"

        Triggers="" />

       <br />

    <Upload:InputFile ID="AttachFile" runat="server" />

    <br />

    <br />

<asp:Button ID="BtnUP" runat="server" onclick="BtnUP_Click" Text="上 传" />

 

后台代码

        protected void BtnUP_Click(object sender, EventArgs e)

        {

            if (AttachFile.HasFile)

            {

                string FileName = this.AttachFile.FileName;//获取上传文件的文件名,包括后缀

                string ExtenName = System.IO.Path.GetExtension(FileName);//获取扩展名

                string SaveFileName = System.IO.Path.Combine(System.Web.HttpContext.Current.Request.MapPath("UpLoads/"), DateTime.Now.ToString("yyyyMMddhhmm") + ExtenName);//合并两个路径为上传到服务器上的全路径

                AttachFile.MoveTo(SaveFileName, Brettle.Web.NeatUpload.MoveToOptions.Overwrite);

                string url = "UpLoads/" + DateTime.Now.ToString("yyyyMMddhhmmss") + ExtenName; //文件保存的路径

                float FileSize = (float)System.Math.Round((float)AttachFile.ContentLength / 1024000, 1); //获取文件大小并保留小数点后一位,单位是M

            }

    }

附图如下
    

 

 

posted @ 2009-12-04 22:07  貔貅  阅读(2647)  评论(1编辑  收藏  举报