首页 > Windows开发 > 详细

C#限制上传文件大小

时间:2019-09-29 12:57:32      阅读:113      评论:0      收藏:0      [点我收藏+]

1.WebConfig:

<system.web>
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" appRequestQueueLimit="100" executionTimeout="80"  maxRequestLength="1048576000" useFullyQualifiedRedirectUrl="false" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>
  </system.web>
  <system.webServer>

<system.webServer>下添加:

<security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1048576000"/>
      </requestFiltering>
    </security>

 

2.应用程序池:
点击该网站的ASP,打开限制属性,更改最大请求实体主体限制,然后点击应用

C#限制上传文件大小

原文:https://www.cnblogs.com/tfeblog/p/11606968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!