34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using PARR.BLL.Domain;
|
|
|
|
namespace PARR.BLL.Services.Interfaces
|
|
{
|
|
public interface IFileService
|
|
{
|
|
Task<UploadResult?> UploadAsync(IFormFile formFile, string[] rootFolderWithoutStorage);
|
|
|
|
/// <summary>
|
|
/// Размер файла не превышает лимит?
|
|
/// </summary>
|
|
/// <param name="formFile"></param>
|
|
/// <param name="limit"></param>
|
|
/// <returns></returns>
|
|
bool IsNotExceededLimit(IFormFile formFile, int limitMb);
|
|
|
|
/// <summary>
|
|
/// Разрешено это расширение?
|
|
/// </summary>
|
|
/// <param name="formFile"></param>
|
|
/// <param name="allowedExtensions"></param>
|
|
/// <returns></returns>
|
|
bool IsExtensionAllowed(IFormFile formFile, string[] allowedExtensions);
|
|
|
|
/// <summary>
|
|
/// Удалить файл
|
|
/// </summary>
|
|
/// <param name="path">Полный путь к файлу</param>
|
|
/// <returns></returns>
|
|
bool DeleteFile(string path);
|
|
}
|
|
}
|