Merge pull request #925 from umbraco/temp-U4-7394

Fixes: U4-7394 Missing maxFilseSize variable from web.config in the b…
This commit is contained in:
Claus
2015-11-25 09:43:55 +01:00

View File

@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.UI;
using ClientDependency.Core.Config;
@@ -177,6 +179,13 @@ namespace Umbraco.Web.Editors
return new JsonNetResult { Data = gridConfig.EditorsConfig.Editors, Formatting = Formatting.Indented };
}
private string GetMaxRequestLength()
{
var section = ConfigurationManager.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
if (section == null) return string.Empty;
return section.MaxRequestLength.ToString();
}
/// <summary>
/// Returns the JavaScript object representing the static server variables javascript object
/// </summary>
@@ -340,6 +349,10 @@ namespace Umbraco.Web.Editors
"imageFileTypes",
string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes)
},
{
"maxFileSize",
GetMaxRequestLength()
},
{"keepUserLoggedIn", UmbracoConfig.For.UmbracoSettings().Security.KeepUserLoggedIn},
{"cssPath", IOHelper.ResolveUrl(SystemDirectories.Css).TrimEnd('/')},
}