Moved the sqlce db to root/App_Data/umbraco.sdf, instead of wwwroot/App_Data/umbraco.sdf

This commit is contained in:
Bjarke Berg
2020-05-04 14:40:11 +02:00
parent 217e634093
commit 305ed42b48
13 changed files with 47 additions and 29 deletions

View File

@@ -1,11 +1,8 @@
using System;
using System.Globalization;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
namespace Umbraco.Web.Common.AspNetCore
{
@@ -77,17 +74,23 @@ namespace Umbraco.Web.Common.AspNetCore
//case LocalTempStorage.Default:
//case LocalTempStorage.Unknown:
default:
return _localTempPath = MapPath("~/App_Data/TEMP");
return _localTempPath = MapPathContentRoot("~/App_Data/TEMP");
}
}
}
public string MapPath(string path)
public string MapPathWebRoot(string path)
{
var newPath = path.TrimStart('~', '/').Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(_webHostEnvironment.WebRootPath, newPath);
}
public string MapPathContentRoot(string path)
{
var newPath = path.TrimStart('~', '/').Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(_webHostEnvironment.ContentRootPath, newPath);
}
public string ToAbsolute(string virtualPath)
{
if (!virtualPath.StartsWith("~/") && !virtualPath.StartsWith("/"))