Log download

This commit is contained in:
SamSys
2025-12-31 20:07:18 +03:30
parent fe66ff5aa3
commit 3c1bf7dff0
3 changed files with 24 additions and 6 deletions

View File

@@ -164,7 +164,7 @@
</div>
<div class="Rtable-cell--content">
<div class="d-flex align-items-center justify-content-end">
<a href="@Url.Page("./Index", "DownloadFile", new { path = @item.FullPath, fileName = @item.FileName })" class="btn-delete1">
<a href="@Url.Page("./Index", "DownloadFileLog", new { path = @item.FullPath, fileName = @item.FileName })" class="btn-delete1">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>

View File

@@ -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);
}
}
}

View File

@@ -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//"