增加IIS7/Win7 Pro上的最大上载文件大小

Jay*_*ido 9 asp.net iis asp.net-mvc upload

我正在为客户端设置服务器(我通常不会这样做),而且我遇到了上传大文件(11MB)的问题.服务器正在运行添加了IIS的Windows 7 Professional.

在web.config中我尝试过设置

<system.web>
    <httpRuntime maxRequestLength="65536" /> <!-- 64MB -->
</system.web>
Run Code Online (Sandbox Code Playgroud)

......那不起作用.

我已经定了

<system.webSecurity>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="68157440" />
        </requestFiltering>
    </security>
</system.webSecurity>
Run Code Online (Sandbox Code Playgroud)

......那也不起作用.

我在这里错过了什么?正如我所说,我通常不会设置服务器,因此我可能会遗漏一些明显的东西......没有任何建议会被嘲笑!

提前致谢.

Dan*_*ner 13

更改system.webSecuritysystem.webServer.

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="52428800"/>
    </requestFiltering>
  </security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

如果这不起作用(由于权限分支),请使用提升的命令提示符下的appcmd进行设置:

appcmd set config"wms/wmsdev"-section:requestFiltering -requestLimits.maxAllowedContentLength:52428800

更多信息:http://bloggingabout.net/blogs/ramon/archive/2009/03/13/how-to-enable-large-file-uploads-in-iis7.aspx


Jay*_*ido 5

事实证明这是前端使用的组件的问题.

值得注意的是(对于将来遇到这种情况的任何人),雅各布和丹的建议都需要这项工作.

无论如何,谢谢你的帮助!非常感激!