|
|
|
@ -12,7 +12,7 @@ namespace AOLBackend.Controllers.Utils |
|
|
|
|
private readonly IFileManagerRepository _Repo; |
|
|
|
|
private readonly IFilePaths4ProcessRepository _RepoRelativePath; |
|
|
|
|
private readonly IConfiguration _config; |
|
|
|
|
private readonly string RootPathCorresponsales; |
|
|
|
|
private readonly string RootPath; |
|
|
|
|
public FileManagerController(IFileManagerRepository Repo, |
|
|
|
|
IFilePaths4ProcessRepository RepoRelativePath, |
|
|
|
|
IConfiguration config) |
|
|
|
@ -20,7 +20,7 @@ namespace AOLBackend.Controllers.Utils |
|
|
|
|
_config = config; |
|
|
|
|
_Repo = Repo; |
|
|
|
|
_RepoRelativePath = RepoRelativePath; |
|
|
|
|
RootPathCorresponsales = _config.GetValue<string>("AllFiles"); |
|
|
|
|
RootPath = _config.GetValue<string>("AllFiles"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Route("GetFileInfoByProcess")] |
|
|
|
@ -48,7 +48,7 @@ namespace AOLBackend.Controllers.Utils |
|
|
|
|
DateTime time = DateTime.Now; |
|
|
|
|
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso); |
|
|
|
|
string fullPath = ""; |
|
|
|
|
fullPath = RootPathCorresponsales + RelativePath.Path; |
|
|
|
|
fullPath = RootPath + RelativePath.Path; |
|
|
|
|
string fileMime = file.FileName.Substring(file.FileName.Length - 4); |
|
|
|
|
string newFileName = file.FileName.Replace(fileMime, "") + "_" + time.ToString("yyyy_MM_dd_HH_mm_ss") + fileMime; |
|
|
|
|
FileManager data = new FileManager(); |
|
|
|
@ -89,7 +89,7 @@ namespace AOLBackend.Controllers.Utils |
|
|
|
|
FileManager recFound = await _Repo.getFileByProcess(id, Proceso); |
|
|
|
|
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso); |
|
|
|
|
string fullPath = ""; |
|
|
|
|
fullPath = RootPathCorresponsales + RelativePath.Path; |
|
|
|
|
fullPath = RootPath + RelativePath.Path; |
|
|
|
|
if (!String.IsNullOrEmpty(recFound.NombreArchivo)) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
@ -126,7 +126,7 @@ namespace AOLBackend.Controllers.Utils |
|
|
|
|
FileManager Found = await _Repo.getFileById(id); |
|
|
|
|
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Found.Proceso); |
|
|
|
|
string fullPath = ""; |
|
|
|
|
fullPath = RootPathCorresponsales + RelativePath.Path; |
|
|
|
|
fullPath = RootPath + RelativePath.Path; |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
if (System.IO.File.Exists(Path.Combine(fullPath, Found.NombreArchivo))) |
|
|
|
|