看这里:公开源码:
http://community.csdn.net/Expert/topic/3214/3214005.xml?temp=.4144709

解决方案 »

  1.   

    1. if your file is modestly large, modify your web.config<httpRuntime executionTimeout="54000" maxRequestLength="512000" /> 2. 参考http://blog.joycode.com/saucer/archive/2004/03/16/16225.aspx
      

  2.   

    also seeLarge File Uploading in ASP.NET
    http://weblogs.asp.net/mhawley/archive/2004/05/11/129824.aspxIn your web.config, add a line under your system.web <httpRuntime executionTimeout="54000" maxRequestLength="512000" /> In your machine.config, modify responseDeadlockInterval to equal the same amount of time for executionTimeout.
      

  3.   

    按saucer(思归/MVP) 说的,改
    《httpRuntime  maxRequestLength》设置最大上载限制
      

  4.   

    可以大于4M的。
    上传大小和控件没关系。是web.config里的设置有关系<httpRuntime executionTimeout="54000" maxRequestLength="512000" /> maxRequestLength 可以设置。
      

  5.   

    上传一个文件  这里我给出一个实例
    <%@ Import Namespace="System.IO" %>
    <%@ page Language="C#" debug="true" %>
    <html>
    <head>
    <title>上传文件 , http://www.chinabs.net/ </title>
    <script language="C#" runat="server">
     //This method is called when the "upload" button id pressed
     public void UploadFile(object sender , EventArgs E)
     {
       //检查上传文件不为空
       if(myFile.PostedFile!=null)
       {     
      string nam = myFile.PostedFile.FileName ;
      //取得文件名(抱括路径)里最后一个"."的索引
      int i= nam.LastIndexOf(".");
      //取得文件扩展名
      string newext =nam.Substring(i);
      //这里我自动根据日期和文件大小不同为文件命名,确保文件名不重复
      DateTime now = DateTime.Now; 
      string newname=now.DayOfYear.ToString()+myFile.PostedFile.ContentLength.ToString(); 
      //保存文件到你所要的目录,这里是IIS根目录下的upload目录.你可以改变.
      //注意: 我这里用Server.MapPath()取当前文件的绝对目录.在asp.net里"\"必须用"\\"代替
      myFile.PostedFile.SaveAs(Server.MapPath("file://upload//)); 
      //得到这个文件的相关属性:文件名,文件类型,文件大小
      fname.Text=myFile.PostedFile.FileName;
      fenc.Text=myFile.PostedFile.ContentType ;
      fsize.Text=myFile.PostedFile.ContentLength.ToString();
       }
     }</script>
    </head>
    <body>
    <center>
    <h3> 文件上传的实例, 来自<a href="http://www.chinabs.net/">中国BS网</a></h3>
    <form id="uploderform" method="post" action="FileUpload.aspx" enctype="multipart/form-data"  runat="server" >
    <table border="1" cellspacing="2" cellpadding="2" >
    <tr> <td><h5>选择要上传的文件:</h5></td</tr>
    <tr>
    <td>
    <input type="file" id="myFile" runat="server" NAME="myFile">
    </td>
    </tr>
    <tr><td>
    <input type="button"  value="上 传" OnServerClick="UploadFile" runat="server" ID="Button1" NAME="Button1">
    </td></tr>
    </table>
    </form>
    <br>
    <br>
    <table border="1" cellspacing="2">
    <tr><td><b>文件资料</b></td>
    <td>&nbsp;</td> 
    </tr>
    <tr>
    <td>文件名 :</td>
    <td><asp:label id="fname" text="" runat="server" /></td></tr>
    <tr>
    <td>文件类型 :</td>
    <td><asp:label id="fenc" runat="server" /></td></tr>
    <tr>
    <td>文件大小 :(in bytes)</td>
    <td><asp:label id="fsize" runat="server" /></td></tr>
    </table>
    <br>
    <br>
    <br>
    </center>
    </body>
    </htm
      

  6.   

    大文件上载的限制由站点的配置文件决定:<httpRuntime executionTimeout="超时" maxRequestLength="上限K" />
      

  7.   


    老大不会吧,电影也要用这个上传,那你就的保证1、设置<httpRuntime executionTimeout="超时" maxRequestLength="上限K" />
    2、设置session的timeout时间足够长;建议传大文件还是用ftp方式比较好
      

  8.   

    http://community.csdn.net/Expert/topic/3225/3225243.xml?temp=.5558893