微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

asp.net – 增加IIS7 / Win7 Pro上的最大上传文件大小

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

在web.config我已经尝试设置

<system.web>
    <httpRuntime maxRequestLength="65536" /> <!-- 64MB -->
</system.web>

…这不行.

我已经设置好了

<system.webSecurity>
    <security>
        <requestfiltering>
            <requestLimits maxAllowedContentLength="68157440" />
        </requestfiltering>
    </security>
</system.webSecurity>

…也不行.

在这里缺少什么?正如我所说,我通常不设置服务器,所以我可能会丢失一些明显的东西,没有任何建议会被嘲笑!

提前致谢.

解决方法

将system.webSecurity更改为system.webServer.
<system.webServer>
  <security>
    <requestfiltering>
      <requestLimits maxAllowedContentLength="52428800"/>
    </requestfiltering>
  </security>
</system.webServer>

如果这不起作用(由于权限分支),请使用提升的命令提示符下的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

原文地址:https://www.jb51.cc/aspnet/246015.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐