Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Umbraco.Core/Configuration/Models/HostingSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public class HostingSettings
[DefaultValue(StaticLocalTempStorageLocation)]
public LocalTempStorage LocalTempStorageLocation { get; set; } = Enum.Parse<LocalTempStorage>(StaticLocalTempStorageLocation);

/// <summary>
/// Gets or sets a value for the location of temporary file uploads.
/// </summary>
/// <value>/umbraco/Data/TEMP/TemporaryFile if nothing is specified.</value>
public string? TemporaryFileUploadLocation { get; set; }

/// <summary>
/// Gets or sets a value indicating whether umbraco is running in [debug mode].
/// </summary>
Expand Down
7 changes: 6 additions & 1 deletion src/Umbraco.Core/Hosting/IHostingEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public interface IHostingEnvironment
string LocalTempPath { get; }

/// <summary>
/// The web application's hosted path
/// Gets the location of temporary file uploads.
/// </summary>
public string TemporaryFileUploadPath => Path.Combine(LocalTempPath, "TemporaryFile");

/// <summary>
/// The web application's hosted path.
/// </summary>
/// <remarks>
/// In most cases this will return "/" but if the site is hosted in a virtual directory then this will return the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalFileSystemTemporaryFileRepository(

private DirectoryInfo GetRootDirectory()
{
var path = Path.Combine(_hostingEnvironment.LocalTempPath, "TemporaryFile");
var path = _hostingEnvironment.TemporaryFileUploadPath;

if (!Directory.Exists(path))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public string LocalTempPath
}
}

/// <inheritdoc />
public string TemporaryFileUploadPath => _hostingSettings.CurrentValue.TemporaryFileUploadLocation
?? Path.Combine(MapPathContentRoot(Core.Constants.SystemDirectories.TempData), "TemporaryFile");

/// <inheritdoc />
public string MapPathWebRoot(string path) => _webHostEnvironment.MapPathWebRoot(path);

Expand Down