如何通过2Gb上传文件到IIS 7.5/.Net 4?

IT *_*DAV 7 .net asp.net iis upload

据我所知,IIS和ASP.NET有2Gb文件上传的限制.在IIS 7.5和.Net 4中是否有任何解决方案?

Mas*_*_ex 1

看看这里

您必须将以下代码添加到应用程序的 web.config 中:

<system.webServer>
<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength ="2147482624" /><!--this value in bytes~2GB-->
    </requestFiltering>
</security>
<system.webServer>
Run Code Online (Sandbox Code Playgroud)

另外,在 web.config 中找到system.web部分和httpRuntime 键,并修改该键的maxRequestLengthexecutionTimeout属性,如我给您的参考文献中所述。

我希望这对你有用。

  • 实际上,maxAllowedContentLength 可以设置为 4294967295,即超过 4Gb。但是超过 2Gb 的文件上传无论如何都会失败。服务器响应 HTTP 错误 400.0 - 错误请求“ASP.NET 检测到 URL 中的无效字符。” 我确信没有任何坏角色。有任何想法吗? (5认同)