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

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....