优化本地文件上传

This commit is contained in:
不做码农
2022-03-22 22:01:47 +08:00
parent c6acbf407e
commit c23b69a883
5 changed files with 66 additions and 31 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Infrastructure.Enums
{
/// <summary>
/// 文件存储位置
/// </summary>
public enum StoreType
{
/// <summary>
/// 本地
/// </summary>
[Description("本地")]
LOCAL = 1,
/// <summary>
/// 阿里云
/// </summary>
[Description("阿里云")]
ALIYUN = 2,
/// <summary>
/// 腾讯云
/// </summary>
[Description("腾讯云")]
TENCENT = 3,
}
}

View File

@@ -16,7 +16,7 @@ namespace Infrastructure
public static string GetdirPath(string path = "")
{
DateTime date = DateTime.Now;
string timeDir = Path.Combine(date.ToString("yyyyMMdd"));// date.ToString("yyyyMM/dd/HH/");
string timeDir = date.ToString("yyyyMMdd");// date.ToString("yyyyMM/dd/HH/");
if (!string.IsNullOrEmpty(path))
{
@@ -28,7 +28,7 @@ namespace Infrastructure
/// <summary>
/// 取文件名的MD5值(16位)
/// </summary>
/// <param name="name">文件名,不包括扩展名</param>
/// <param name="str">文件名,不包括扩展名</param>
/// <returns></returns>
public static string HashFileName(string str = null)
{