修改文件存储

This commit is contained in:
不做码农
2022-06-09 08:37:31 +08:00
parent ef9baadf92
commit 687160e0ae
5 changed files with 29 additions and 21 deletions

View File

@@ -110,13 +110,15 @@ namespace ZR.Admin.WebApi.Controllers
switch (storeType)
{
case StoreType.LOCAL:
string savePath = AppSettings.App(new string[] { "Upload", "localSavePath" });
if (savePath.IsEmpty())
string savePath = Path.Combine(WebHostEnvironment.WebRootPath);
if (fileDir.IsEmpty())
{
savePath = Path.Combine(WebHostEnvironment.WebRootPath, "uploads");
fileDir = AppSettings.App(new string[] { "Upload", "localSavePath" });
}
file = await SysFileService.SaveFileToLocal(savePath, fileName, fileDir, HttpContext.GetName(), formFile);
break;
case StoreType.REMOTE:
break;
case StoreType.ALIYUN:
if ((fileSize / 1024) > MaxContentLength)
{