diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml index 9220ef4a..73968c84 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml @@ -164,7 +164,7 @@
- + diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml.cs b/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml.cs index 894764b7..de2e2326 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml.cs +++ b/ServiceHost/Areas/AdminNew/Pages/Company/FileBackup/Index.cshtml.cs @@ -1,4 +1,4 @@ -using _0_Framework.Application; +using _0_Framework.Application; using _0_Framework.Infrastructure; using _0_Framework.InfraStructure; using backService; @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Configuration.UserSecrets; +using System.IO; namespace ServiceHost.Areas.AdminNew.Pages.Company.FileBackup { @@ -68,8 +69,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.FileBackup { FileName = Path.GetFileName(x), FullPath = x, - CreationDate = Path.GetFileName(x).ExtractTimeFromInsurancebackup(), - }).OrderByDescending(x => x.CreationDate).ToList(); + CreationDate = new DateTime(), + }).ToList(); #endregion @@ -89,5 +90,22 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.FileBackup byte[] fileContent = System.IO.File.ReadAllBytes(path); return File(fileContent, "application/zip", fileName); } - } + + + public IActionResult OnGetDownloadFileLog(string path, string fileName) + { + if (!System.IO.File.Exists(path)) + return NotFound(); + + var stream = new FileStream( + path, + FileMode.Open, + FileAccess.Read, + FileShare.ReadWrite // 🔑 کلید حل مشکل + ); + + return File(stream, "text/plain", fileName); + } + + } } diff --git a/ServiceHost/appsettings.json b/ServiceHost/appsettings.json index eb43b160..e5286144 100644 --- a/ServiceHost/appsettings.json +++ b/ServiceHost/appsettings.json @@ -22,7 +22,7 @@ "DbName": "mesbah_db", "DbBackupZipPath": "c://EveryHourBackupList//", "FastDbBackupZipPath": "c://FastBackupZipList//", - "InsuranceListZipPath": "c://InsuranceListZipPath//" + "InsuranceListZipPath": "c://Logs//Gozareshgir//" }, "faceModels": { "Faces": "c://labels//20//"