1


I have an aspx page. The page contains asp:FileUpload control.
When I try to save the browsed file path to xml file locally, it works fine.
But when I try to browse it from IIS [8.5] - I get this error:

HTTP Error 404.13 - Not Found

The request filtering module is configured to deny a request that exceeds the request content length.

I tried to add maxRequestLength, an it didn't help.
When I try to add the following code:

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

I get this error:

Server Error in '/' Application.

My web.config is:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    <httpRuntime maxRequestLength="1048576" />
  </system.web>
<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1073741824" />
    </requestFiltering>
  </security>
</system.webServer>
</configuration>

The SaveData() function causes this failure is:

private void SaveData()
{
    try
    {
        VfilesDataSet.WriteXml(Server.MapPath("source.xml"));
    }
    catch (Exception ex)
    {
        EventLog.WriteEntry("MyProgram", ex.ToString(), EventLogEntryType.Error);
        throw;
    }   
}

By the way, no exception is written to log.

Can anyone tell me please what am I do wrong?

Tali B.
  • 125
  • 1
  • 11
  • Did you try setting `` in Web.config? The value is currently `1048576`. – ConnorsFan May 30 '16 at 12:17
  • @ConnorsFan yes, I tried. Still the same errors. With and without tag. – Tali B. May 30 '16 at 13:04
  • My previous comment was off the mark... Another suggestion: did you set the request limits on IIS? See point 2 in this article: http://ajaxuploader.com/large-file-upload-iis-asp-net.htm. – ConnorsFan May 30 '16 at 13:52

0 Answers0