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?