IT Hit WebDAV
IT Hit WebDAV

Reputation: 5894

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

As 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?

Upvotes: 7

Views: 6844

Answers (2)

Joel Harris
Joel Harris

Reputation: 1966

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.

Upvotes: 2

Master_ex
Master_ex

Reputation: 779

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.

Upvotes: 1

Related Questions