IIS7 - WebRequest的时候请求参数的大小超过30MB有404.13失败 [英] IIS7 - Webrequest failing with a 404.13 when the size of the request params exceeds 30mb

查看:627
本文介绍了IIS7 - WebRequest的时候请求参数的大小超过30MB有404.13失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的WebMethod

  [的WebMethod] 
公众诠释myWebMethod(字符串文件名,字节[] fileContent )

但是,每当我路过一个字节数组是大于30MB,我得到的错误:




HTTP错误404.13 - 找不到
中的请求滤波模块配置为拒绝超出请求内容长度的请求


我的web.config如下:

 <结构> 
<&的System.Web GT;
<编译调试=真targetFramework =4.0> < /编译>
<身份验证模式=窗口/>
<的httpRuntime useFullyQualifiedRedirectUrl =真正的
的maxRequestLength =102400requestLengthDiskThreshold =102400
/>
<页面controlRenderingCompatibilityVersion =3.5的ClientIDMode =自动识别/>
< /system.web>
< system.webServer>
<安全>
<&的requestFiltering GT;
< requestLimits maxAllowedContentLength =104857600/>
< /&的requestFiltering GT;
< /安全>
< /system.webServer>
< /结构>



我四处搜寻,而这个问题的最常见的原因是 maxAllowedContentLength 属性被默认为30MB。不过,我已经设置这是100MB,以及为的maxRequestLength 属性的httpRuntime



我无法找到一个解决办法的任何地方未设置我已经试过以上的属性之一。是不是我错过了什么?


解决方案

您的问题可能在于一个事实,即在设置在 web.config中取得文件可能通过在两个对ApplicationHost.config machine.config中文件。



对应的当前设置所取代

如果你有机会获得这些,检查 overrideModeDefault 相应部分的属性被设置为允许,如下面的例子:




machine.config中




 <的requestFiltering overrideModeDefault =允许> 
< requestLimits maxAllowedContentLength =104857600/>
< /&的requestFiltering GT;



据我所知是没有办法来覆盖这些设置,如果你没有获得相应的配置文件



您可能会发现有关系统范围内的配置和设置的详细信息覆盖的 这里 ,的 这里 和的 这里 - 和一个非常相似的情况下的 这里


I have a simple webmethod

[WebMethod]
public int myWebMethod(string fileName, Byte[] fileContent)

However, whenever I pass a byte array which is larger than 30mb, I get the error:

HTTP Error 404.13 - Not Found The request filtering module is configured to deny a request that exceeds the request content length.

My web.config is as follows:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0"> </compilation>
    <authentication mode="Windows" />
    <httpRuntime useFullyQualifiedRedirectUrl="true"
                 maxRequestLength="102400" requestLengthDiskThreshold="102400"
    />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="104857600"/>
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

I've searched around, and the most common cause of this problem is the maxAllowedContentLength property being 30mb by default. However, I have set this to be 100mb, as well as the maxRequestLength property for httpRuntime.

I can't find a solution anywhere which isn't setting one of the properties I've already tried above. Is there something I have missed?

解决方案

You problem may lie in the fact that settings made in the web.config file may be superseded by corresponding settings present in both the applicationhost.config and machine.config files.

If you have access to these, check if the overrideModeDefault property of the corresponding sections are set to Allow, as in the following example:

machine.config

<requestFiltering overrideModeDefault="Allow">
    <requestLimits maxAllowedContentLength="104857600"/>        
</requestFiltering>

AFAIK there is no way to override these settings if you don't have access to the corresponding configuration file.

You may find more information about system-wide configuration and settings override here, here and here - and a very similar case here.

这篇关于IIS7 - WebRequest的时候请求参数的大小超过30MB有404.13失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆