diff --git a/CoreCms.Net.Services/Com/ToolsServices.cs b/CoreCms.Net.Services/Com/ToolsServices.cs index 410386ed..00fa0669 100644 --- a/CoreCms.Net.Services/Com/ToolsServices.cs +++ b/CoreCms.Net.Services/Com/ToolsServices.cs @@ -255,6 +255,9 @@ namespace CoreCms.Net.Services var jm = new AdminUiCallBack(); var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_fffff", DateTimeFormatInfo.InvariantInfo) + fileExt; + var today = DateTime.Now.ToString("yyyyMMdd"); + var filePath = options.Path.TrimStart('/') + today + "/" + newFileName; //云保存路径 + Mac mac = new Mac(options.AccessKeyId, options.AccessKeySecret); @@ -283,7 +286,7 @@ namespace CoreCms.Net.Services config.ChunkSize = ChunkUnit.U512K; UploadManager um = new UploadManager(config); - var outData = um.UploadData(bytes, newFileName, token, null); + var outData = um.UploadData(bytes, filePath, token, null); return options.BucketBindUrl + newFileName; } @@ -426,6 +429,8 @@ namespace CoreCms.Net.Services public string UpLoadBase64ForQiNiuKoDo(FilesStorageOptions options, byte[] bytes) { var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_fffff", DateTimeFormatInfo.InvariantInfo) + ".jpg"; + var today = DateTime.Now.ToString("yyyyMMdd"); + var filePath = options.Path.TrimStart('/') + today + "/" + newFileName; //云保存路径 Mac mac = new Mac(options.AccessKeyId, options.AccessKeySecret); @@ -447,7 +452,7 @@ namespace CoreCms.Net.Services config.ChunkSize = ChunkUnit.U512K; UploadManager um = new UploadManager(config); - var outData = um.UploadData(bytes, newFileName, token, null); + var outData = um.UploadData(bytes, filePath, token, null); return options.BucketBindUrl + newFileName; }