} // SetWebSiteUploadLimitation
private int GetWebSiteUploadLimitation(Microsoft.Web.Administration.Configuration oConfig, string sControllerAction)
{
int nResult = 0;
try {
ConfigurationSection requestFilteringSection = string.IsNullOrWhiteSpace(sControllerAction)
? oConfig.GetSection(SectionPath)
: oConfig.GetSection(SectionPath, sControllerAction);
ConfigurationElement requestLimitsElement = requestFilteringSection.GetChildElement(ElementName);
ConfigurationAttribute oAttr = requestLimitsElement.GetAttribute(AttributeName);
if (oAttr != null)
{
int macl;
if (int.TryParse(oAttr.Value.ToString(), out macl))
{
nResult = macl;
}
else
{
m_oLog.Warn("Failed to parse upload limit for action '{0}'.", sControllerAction);
}
} // if
m_oLog.Debug("Current upload limit for action '{1}' is {0} bytes.", nResult, sControllerAction);
}
catch (Exception e) {
m_oLog.Warn(e, "Failed to load upload limit for action '{0}'.", sControllerAction);
} // try
return(nResult);
} // GetWebSiteUploadLimitation