file upload issue

asp.net, c#, iis, upload

Solution

    <system.web>
        <httpRuntime executionTimeout="300" maxRequestLength="512000" />
    </system.web>

This will not work in IIS7! httpRuntime is for IIS6 and bellow. The correct way to allow large file uploads in IIS7 is:

1) Add the following lines to the web.config file:

[Web.config] maxAllowedContentLength attribute for IIS7

<system.webServer>
   <security >
      <requestFiltering>
          <requestLimits maxAllowedContentLength="1024000000" />
      </requestFiltering>
   </security>
</system.webServer>

2)Then open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:

<section name="requestFiltering" overrideModeDefault="Allow" />

overrideModeDefault should be Allow.

Problem

I will need client (end user) through browser to upload big files (e.g. similar to Youtube's scenario which uploads big video files), the file size should be no larger than 500M bytes. I am using ASP.Net + C# + VSTS + IIS 7.0 as my development platform. Any ideas or good practices about how to handle big file upload issue? Any reference samples or documents are appreciated.

Original source

Related problems