Study 上传 迁移
This commit is contained in:
@@ -1222,6 +1222,59 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
}
|
||||
|
||||
public enum UploadFileType
|
||||
{
|
||||
DataUpload = 1,
|
||||
|
||||
DataDownload = 2,
|
||||
|
||||
EmailAttachment = 3,
|
||||
|
||||
EmailBodyHtml = 4,
|
||||
|
||||
Other = 5
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 1:数据上传 2:导出、 3:邮件附件 4:邮件Html 通过 ----new
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("SystemFile/Upload")]
|
||||
[DisableRequestSizeLimit]
|
||||
[DisableFormValueModelBinding]
|
||||
public async Task<IResponseOutput> Upload(UploadFileType fileType)
|
||||
{
|
||||
IResponseOutput result = null;
|
||||
|
||||
switch (fileType)
|
||||
{
|
||||
case UploadFileType.DataUpload:
|
||||
result = await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemFileUploadPath(_hostEnvironment, StaticData.Folder.DataTemplate, fileName));
|
||||
|
||||
break;
|
||||
case UploadFileType.DataDownload:
|
||||
result = await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemFileUploadPath(_hostEnvironment, StaticData.Folder.DataTemplate, fileName));
|
||||
|
||||
break;
|
||||
case UploadFileType.EmailAttachment:
|
||||
result = await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemFileUploadPath(_hostEnvironment, StaticData.Folder.EmailTemplate, fileName));
|
||||
|
||||
break;
|
||||
|
||||
case UploadFileType.EmailBodyHtml:
|
||||
result = await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemFileUploadPath(_hostEnvironment, StaticData.Folder.EmailTemplate, fileName));
|
||||
break;
|
||||
|
||||
default:
|
||||
result = await SingleFileUploadAsync((fileName) => FileStoreHelper.GetOtherFileUploadPath(_hostEnvironment, StaticData.Folder.TempFile, fileName));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user