1

I am trying to have a basic feature for uploading audio files to my website. I ran across the max length error and used the solution found here. However, whenever I try to run the website I get HTTP Error 500.19 with error code 0x800700b7. My web I config looks like this:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
        <httpRuntime maxRequestLength="1048576" />
  </system.web>
  <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
   </security>
 </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

I have searched the internet. I tried this, and it didn't do anything. I can't do this because I need the line to the malformed lined to change the max length. This didn't help me at. What can I do to fix this? If it matters, I am using C#.

White Eagle
  • 123
  • 1
  • 8
  • Please seriously learn IIS configuration system, and that can save you tons of hours searching pointlessly. Unless your server administrators allow you to override request filtering in `web.config`, that section can only appear in `applicationHost.config`. – Lex Li Mar 14 '18 at 22:50
  • @LexLi I am currently a one man team. I am the designer, the coder, and the server administrator. I am just trying to run the site locally right now. Are you saying I need to change the maximum size in applicationHost.config? Thanks. – White Eagle Mar 15 '18 at 11:51

1 Answers1

1

I managed to figure out my problem and thought I would post it here in case it would help anyone. It turns out that:

<httpRuntime targetFramework="4.5.2"/>
        <httpRuntime maxRequestLength="1048576" />

Should have been:

<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576" />

Referencing httpRuntime twice was the problem.

White Eagle
  • 123
  • 1
  • 8