修改存储路径

Test.EIImageViewer
hang 2022-05-27 16:38:23 +08:00
parent b5f09e9774
commit b032ee5ab6
2 changed files with 9 additions and 4 deletions

View File

@ -206,7 +206,6 @@ namespace IRaCIS.Core.API.Controllers
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath); if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
var (trustedFileNameForFileStorage, fileName) = FileStoreHelper.GetStoreFileName(fileRealName); var (trustedFileNameForFileStorage, fileName) = FileStoreHelper.GetStoreFileName(fileRealName);

View File

@ -22,6 +22,7 @@ using IRaCIS.Core.Application.Service.Inspection.DTO;
using Nito.AsyncEx; using Nito.AsyncEx;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Helper;
namespace IRaCIS.Core.Application.Image.QA namespace IRaCIS.Core.Application.Image.QA
{ {
@ -535,7 +536,7 @@ namespace IRaCIS.Core.Application.Image.QA
// return ResponseOutput.NotOk("只有PM/APM具有操作权限!"); // 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(); var fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.ToString().Trim('"').ToLower();
if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls")) 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)) 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)) using (FileStream fs = System.IO.File.Create(filePath))
{ {
await file.CopyToAsync(fs); await file.CopyToAsync(fs);