title: Request content length of asp:FileUpload control
body: <p><br/>
  I have an aspx page. The page contains <b>asp:FileUpload</b> control. <br/>
  When I try to save the browsed file path to xml file locally, it works fine.<br/>
  But when I try to browse it from IIS [8.5] - I get this error:<br/><br/>
  HTTP Error 404.13 - Not Found</p>
  
  <p>The request filtering module is configured to deny a request that exceeds the request content length.
  <br/><br/>
  I tried to add <b>maxRequestLength</b>, an it didn't help.<br/>
  When I try to add the following code: <br/></p>
  
  <pre><code>&lt;system.webServer&gt;
     &lt;security&gt;
      &lt;requestFiltering&gt;
        &lt;requestLimits maxAllowedContentLength="1073741824" /&gt;
      &lt;/requestFiltering&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;`
  </code></pre>
  
  <p>I get this error: <br/></p>
  
  <h2>    Server Error in '/' Application.</h2>
  
  <p>My web.config is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;customErrors mode="Off"/&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
          &lt;add assembly="PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;httpRuntime maxRequestLength="1048576" /&gt;
    &lt;/system.web&gt;
  &lt;system.webServer&gt;
    &lt;security&gt;
      &lt;requestFiltering&gt;
        &lt;requestLimits maxAllowedContentLength="1073741824" /&gt;
      &lt;/requestFiltering&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The SaveData() function causes this failure is:</p>
  
  <pre><code>private void SaveData()
  {
      try
      {
          VfilesDataSet.WriteXml(Server.MapPath("source.xml"));
      }
      catch (Exception ex)
      {
          EventLog.WriteEntry("MyProgram", ex.ToString(), EventLogEntryType.Error);
          throw;
      }   
  }
  </code></pre>
  
  <p>By the way, no exception is written to log.<br/><br/>
  Can anyone tell me please what am I do wrong?</p>