You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var appDataFolder = UmbracoContext.HttpContext.Server.MapPath("~/App_Data");
v9
The App_Data folder is no longer a special 'protected' folder. Steps can be taken to ensure that all its contents is protected, but for our purposes we actually don't need it to be protected. So we chose a different folder name to avoid future confusion about whether App_Data is actually protected or not.
public class GuestbookApiController : UmbracoApiController
{
private readonly IWebHostEnvironment _webHostEnvironment;
public GuestbookApiController(IWebHostEnvironment webHostEnvironment)
{
_webHostEnvironment = webHostEnvironment;
}
public string GetEntries(string id)
{
var githubFolder = _webHostEnvironment.ContentRootPath + "\\wwwroot\\github";
}
}
PS we know it is good practice to create paths using Path.Combine instead of the approach above. Something else to do ;-)
The text was updated successfully, but these errors were encountered:
v8
var appDataFolder = UmbracoContext.HttpContext.Server.MapPath("~/App_Data");
v9
The App_Data folder is no longer a special 'protected' folder. Steps can be taken to ensure that all its contents is protected, but for our purposes we actually don't need it to be protected. So we chose a different folder name to avoid future confusion about whether App_Data is actually protected or not.
PS we know it is good practice to create paths using
Path.Combine
instead of the approach above. Something else to do ;-)The text was updated successfully, but these errors were encountered: