我需要测试一个可以接受非常大文件的文件上传组件。我想在开发环境中进行本地测试,但是由于我使用IIS Express而不是IIS 7,所以我不确定在哪里进行全局更改。
在IIS 7中,无法通过web.config进行更改,而需要通过IIS管理器工具进行更改。有关示例,请参见此IIS文章。
有谁知道如何使用IIS Express(在Visual Studio 2013中)进行相同的全局更改?
如果建议的web.config更改ppascualv不起作用,请尝试将其放入IIS Express applicationhost.config中,该文件位于
%userprofile%\my documents\iisexpress\config\applicationhost.config
Run Code Online (Sandbox Code Playgroud)
下
<system.webServer>
Run Code Online (Sandbox Code Playgroud)
放
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000"/>
</requestFiltering>
</security>
Run Code Online (Sandbox Code Playgroud)
除非应用程序中的web.config覆盖它,否则应将其设置为全局。
您基本上需要在web.config maxRequestLength和maxAllowedContentLength上传文件中进行设置。
maxRequestLength 表示 ASP.NET 支持的最大文件上传大小maxAllowedContentLength 这指定了 IIS 支持的请求中内容的最大长度。注意:maxRequestLength以千字节maxAllowedContentLength为单位,以字节为单位
默认情况下,Machine.config 被配置为接受最大 4096 KB (4 MB) 的 HTTP 请求,它反映在您的所有 ASP.NET 应用程序中。您可以直接更改 Machine.config 文件,也可以仅更改要更改的应用程序的 Web.config 文件
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000"/>
</requestFiltering>
</security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9624 次 |
| 最近记录: |