Advertisements

Uploading Large Files to IIS / ASP.NET


When we upload a large file in asp.net using file upload control we got a error.so how to over come this ? The Default size of Asp.Net is 4MB.

Code

In Web.Config put this code.

//In IIS 7

<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
</system.web>
<system.webServer>
<security>
<requestFiltering><requestLimits maxAllowedContentLength="3000000000" /></requestFiltering>
</security>
</system.webServer>

The below code maxRequestLength measured in kilobytes.Here is an example with a 1GB request length and a 10 minute request timeout:

<httpRuntime maxRequestLength="1048576" executionTimeout="600" />  
[/html]

The below code maxAllowedContentLength measured in bytes. 

<requestLimits maxAllowedContentLength="3000000000" />  
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: