I\'d like to have more than 1 setting for maxRequestLength - file size upload limitation (e.g. one for File/New, other for Picture/New). All of my Actions take additional pa
I believe the Path attribute shouldn't start or end with a "/" - so you should have:
<location path="File">
<system.web>
<httpRuntime executionTimeout="60" maxRequestLength="4096" />
</system.web>
</location>
<location path="Picture">
<system.web>
<httpRuntime executionTimeout="60" maxRequestLength="1024" />
</system.web>
</location>
Your virtual or physical directory–level Web.config's shouldn't have the <location> elements.
That should sort you out.
The docs for the Location element even have this very example:
The following code example demonstrates how to set the uploaded file size limit to 128 KB for only the page specified.
<configuration>
<location path="UploadPage.aspx">
<system.web>
<httpRuntime maxRequestLength="128"/>
</system.web>
</location>
</configuration>