mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 15:43:27 +08:00
后台【优化】:优化七牛云上传,增加文件夹模式。
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user