设置服务器端的maxRequestLength="10240000"看看

解决方案 »

  1.   

    //判断文件是否大于1M
    long asq=1024900;
    if(Convert.ToInt64(FileUp.PostedFile.ContentLength) > asq)
    {
    Label3.Text="[上传的文件太大,最大支持1M!]";
    }
    其中FileUp为File Field
      

  2.   

    在服务器端应在哪设置?因为不是ASP.NET的程序,所以我找不到WEB.CONFIG
      

  3.   

    <configuration>
       <system.web>
          <httpRuntime maxRequestLength="4000"
             useFullyQualifiedRedirectUrl="true"
             executionTimeout="45"
             versionHeader="1.1.4128"/>
       </system.web>
    </configuration>