开发者

How to upload files over 2Gb to IIS 7.5 / .Net 4?

As开发者_Go百科 far as I know IIS and ASP.NET has a limitation of 2Gb files upload. Are there any solutions for this in IIS 7.5 and .Net 4?


I found a blog post that explains the cryptic error "ASP.NET detected invalid characters in the URL."

From the blog post:

When the integrated pipeline is used, we go though webengine code (webengine4!MgdGetRequestBasics) which doesn't support more than 2 GB content-length and a System.ArithmeticException exception is raised which subsequently cause the HTTP 400 error. With the classic pipeline, we don't use webengine4 but the old ASPNET_ISAPI model and we don't hit the above issue.

The post also describes how the author was able to upload files larger than 2 gigs.


Have a look here.

You have to add to your application's web.config the following code:

<system.webServer>
<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength ="2147482624" /><!--this value in bytes~2GB-->
    </requestFiltering>
</security>
<system.webServer>

Also in web.config find the system.web section and the httpRuntime key and modify the maxRequestLength and executionTimeout attributes of this key as mentioned in the reference I gave you.

I hope this works for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜