修改存储路径

This commit is contained in:
2022-05-27 16:38:23 +08:00
parent b5f09e9774
commit b032ee5ab6
2 changed files with 9 additions and 4 deletions
@@ -22,6 +22,7 @@ using IRaCIS.Core.Application.Service.Inspection.DTO;
using Nito.AsyncEx;
using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Helper;
namespace IRaCIS.Core.Application.Image.QA
{
@@ -535,7 +536,7 @@ namespace IRaCIS.Core.Application.Image.QA
// return ResponseOutput.NotOk("只有PM/APM具有操作权限!");
//}
var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
var fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.ToString().Trim('"').ToLower();
if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls"))
@@ -544,7 +545,7 @@ namespace IRaCIS.Core.Application.Image.QA
}
//上传根路径
string uploadFolderPath = Path.Combine(rootPath, "UploadFile", "Check");
string uploadFolderPath = Path.Combine(rootPath,StaticData.TrialDataFolder, trialId.ToString(), "CheckExcel");
if (!Directory.Exists(uploadFolderPath))
{
@@ -552,7 +553,12 @@ namespace IRaCIS.Core.Application.Image.QA
}
//存放核对表
var filePath = Path.Combine(uploadFolderPath, DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + fileName);
var (trustedFileNameForFileStorage, fileName) = FileStoreHelper.GetStoreFileName(fileName);
var filePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
using (FileStream fs = System.IO.File.Create(filePath))
{
await file.CopyToAsync(fs);