C#上传文件 错误代码500,上传文件过大问题

1 在代用C#上传接口时,ajax请求失败,错误代码500,代码没有问题的情况下,请检查后台接口程序的Web.config,在system.web中配置httpRuntime标签,程序默认的上传文件上限是4M,需要根据项目需求设置上传文件的大小。增加以下代码

<system.web>
    <compilation targetFramework="4.6.1" debug="true" />
    <!--最大请求长度,单位为KB(千字节),默认为4M,设置为40M,上限为2G -->
    <httpRuntime targetFramework="4.6.1" maxRequestLength="40960" executionTimeout="3600" />
  </system.web>

猜你喜欢

转载自blog.csdn.net/zhang123csdn/article/details/132224846