diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index 53c6c325d..7ba0356f9 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -777,13 +777,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate string[] strArry = url.Split('/'); savePath = savePath + "/" + strArry[strArry.Length - 1]; } + + var directory = Path.GetDirectoryName(savePath); + if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + await _oSSService.DownLoadFromOSSAsync(url, savePath); return savePath; } - catch (Exception) + catch (Exception ex) { - + Log.Logger.Error(ex.Message + ex.StackTrace); throw new BusinessValidationFailedException(_localizer["ReadingCalculate_ImageNotExist"]); }