谢谢各位 我自己解决了,就是在Web.config中修改<httpRuntime maxRequestLength="2024000" executionTimeout="300"/>中的maxRequestLength属性修改就可以了,一般默认4兆.

解决方案 »

  1.   

    方法2:
    1.   httpHandler or HttpModule
    a.在asp.net进程处理request请求之前截获request对象
    b.分块读取和写入数据
    c.实时跟踪上传进度更新meta信息2.   利用隐含的HttpWorkerRequest用它的GetPreloadedEntityBody 和 ReadEntityBody方法处理文件流
    IServiceProvider provider = (IServiceProvider) HttpContext.Current; 
      HttpWorkerRequest wr = (HttpWorkerRequest) provider.GetService(typeof(HttpWorkerRequest));
      byte[] bs = wr.GetPreloadedEntityBody();
      ....
      if (!wr.IsEntireEntityBodyIsPreloaded())
      {
            int n = 1024;
            byte[] bs2 = new byte[n];
            while (wr.ReadEntityBody(bs2,n) >0)
           {
                 .....
            }
      }3.   自定义Multipart MIME 解析器
    自动截获MIME分割符
    将文件分块写如临时文件
      

  2.   

    请问楼主,那段要写在webconfig哪个地方???
      

  3.   

    <httpRuntime> 
                executionTimeout="110"              //允许上传文件最大等待时间
                maxRequestLength="4096"        //上传文件大小,默认为4M
           </httpRuntime>
      

  4.   

    包含在system.web里
    <system.web>
    <httpRuntime> 
                executionTimeout="110"              //允许上传文件最大等待时间
                maxRequestLength="4096"        //上传文件大小,默认为4M
           </httpRuntime></system.web>