Initial commit: Lagerbestand Blazor Projekt
This commit is contained in:
commit
cba9414e92
105 files changed
+36431
No files matched your search
@@ -0,0 +1,48 @@
|
||||
namespace Lagerbestand.Models;
|
||||
|
||||
/// <summary>
|
||||
/// File storage settings for NFS/disk-based file storage
|
||||
/// </summary>
|
||||
public class FileStorageSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Base path for file storage (e.g., /mnt/nfs/attachments or C:\Storage\Attachments)
|
||||
/// </summary>
|
||||
public string BasePath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Whether file storage is configured and enabled
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Maximum file size in bytes (default: 10 MB)
|
||||
/// </summary>
|
||||
public long MaxFileSizeBytes { get; set; } = 10 * 1024 * 1024;
|
||||
|
||||
/// <summary>
|
||||
/// Validates if the storage path is accessible
|
||||
/// </summary>
|
||||
public bool IsPathAccessible()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(BasePath))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
return Directory.Exists(BasePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full path for a given relative file path
|
||||
/// </summary>
|
||||
public string GetFullPath(string relativePath)
|
||||
{
|
||||
return Path.Combine(BasePath, relativePath);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user