IIS7 - 请求滤波模块配置为拒绝超出请求内容长度的请求 [英] IIS7 - The request filtering module is configured to deny a request that exceeds the request content length

查看:232
本文介绍了IIS7 - 请求滤波模块配置为拒绝超出请求内容长度的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要上传的图片,它工作正常,我的机器上,但是当我把我的网站IIS7服务器上公开,我不能上传任何东西。

错误


  

的请求滤波模块配置为拒绝请求该
  超过请求内容长度。


最可能的原因


  

请求过滤在Web服务器上配置拒绝请求
  因为内容长度超过配置的值。


可尝试


  

验证configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength
  在对ApplicationHost.config或Web.config文件设置。


system.webServer Web.config中

 < system.webServer>
    <验证validateIntegratedModeConfiguration =FALSE/>
    <模块runAllManagedModulesForAllRequests =真/>
    <安全>
      <&的requestFiltering GT;
         < requestLimits maxAllowedContentLength =1048576/>
      < /&的requestFiltering GT;
   < /安全>
  < /system.webServer>

正如你可以看到我把我的maxAllowedContentLength为1GB。重新启动我的网站,仍然收到此错误。我做了一个 /上传/ 文件夹我的文件系统,在那里想成为好上。不知道是什么原因导致这个错误,我为什么不能上传图片。


解决方案

 <结构>
    <&的System.Web GT;
        <的httpRuntime的maxRequestLength =1048576/>
    < /system.web>
< /结构>

I want to upload images, it works fine on my machine but when I put my website on IIS7 server for public I can't upload anything.

Error

The request filtering module is configured to deny a request that exceeds the request content length.

Most likely causes

Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value.

Things you can try

Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file.

system.webServer in Web.config

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1048576" />
      </requestFiltering>
   </security>
  </system.webServer>

As you can see I set my maxAllowedContentLength to 1gb. Restarted my website and still getting this error. I made an /uploads/ folder on my file system where it suppose to be as well. Have no idea what causes this error and why I can't upload images.

解决方案

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="1048576" />
    </system.web>
</configuration>

From here.

这篇关于IIS7 - 请求滤波模块配置为拒绝超出请求内容长度的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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