Asp.net 上传文件报“超过最大请求长度”黄页,解决方法随笔

客户在软件使用过程中上传文件操作时反应报错,无法上传。查找原因是报“超过最大请求长度”和“超出json长度”错误,判断是base64加密后的路径太长和文件超过4M导致的。

做了三个地方参数配置来解决问题;

1、maxRequestLength

 

<system.web>
  <httpRuntime targetFramework="4.5" maxRequestLength="2097151" />
</system.web>

2、maxAllowedContentLength

<system.webServer>
  <security>
    <requestfiltering >
      <requestLimits maxAllowedContentLength="2147483647" ></requestLimits>
    </requestfiltering>
  </security>
</system.webServer>

3、maxJsonLength

<system.web.extensions>
    <scripting>
        <webServices>
            <jsonSerialization maxJsonLength="1024000000" />
        </webServices>
    </scripting>
</system.web.extensions>

 

相关文章

数组的定义 Dim MyArray MyArray = Array(1‚5‚123‚12‚98...
\'参数: \'code:要检测的代码 \'leixing:html或者ubb \'n...
演示效果: 代码下载: 点击下载
环境:winxp sp2 ,mysql5.0.18,mysql odbc 3.51 driver 表采...
其实说起AJAX的初级应用是非常简单的,通俗的说就是客户端(j...
<% ’判断文件名是否合法 Function isFilename(aFilename...