Search code examples
c#asp.netiis-7server-error

How to Upload Large files in Application Folder


In my application I'm uploading large audio files (upto 100MB). For that in my web.config file I have added:

<httpRuntime executionTimeout="90" maxRequestLength="150000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true" />

With this code I'm uploading files successfully into my application folder. But when deployed in IIS and published locally, the files are not uploading and I'm getting this Error. How can i solve this issue?


Solution

  • In addition to the check specified in the httpRuntime node, I believe microsoft is now also checking the content length as part of the security filtering. You may be able to get past the size limits by adding the following node to your web.config

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