From 1fbda0327c1dc0ee6e97e26e9bef22d7b75b56f5 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 20 May 2026 11:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dcm=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/OSSService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/IRC.Core.SCP/Service/OSSService.cs b/IRC.Core.SCP/Service/OSSService.cs index 19b51a8a3..35e58939d 100644 --- a/IRC.Core.SCP/Service/OSSService.cs +++ b/IRC.Core.SCP/Service/OSSService.cs @@ -825,10 +825,12 @@ public class OSSService(IOptionsMonitor options, if (ObjectStoreServiceOptions.IsOpenStoreSync && uploadInfo != null) { + var fileType = Path.GetExtension(returnPath).TrimStart('.'); + uploadInfo.FileSize = fileStream.CanSeek ? fileStream.Length : 0; uploadInfo.Path = returnPath; uploadInfo.FileName = fileRealName; - uploadInfo.FileType = Path.GetExtension(returnPath).TrimStart('.'); + uploadInfo.FileType = fileType.IsNullOrEmpty()?"dcm": fileType; await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo); @@ -964,10 +966,14 @@ public class OSSService(IOptionsMonitor options, if (ObjectStoreServiceOptions.IsOpenStoreSync && uploadInfo != null) { + + var fileType = Path.GetExtension(returnPath).TrimStart('.'); + uploadInfo.FileSize = fileSize; uploadInfo.Path = returnPath; uploadInfo.FileName = Path.GetFileName(localFilePath); - uploadInfo.FileType = Path.GetExtension(returnPath) == "" ? "dcm" : Path.GetExtension(returnPath); + uploadInfo.FileType = fileType.IsNullOrEmpty() ? "dcm" : fileType; + await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo);