|
@@ -214,27 +214,48 @@ public class DefaultFileStorage : IFileStorage, IScopeDependency
|
|
|
{
|
|
|
//TODO验证文件格式
|
|
|
var extList = new List<string>();
|
|
|
- extList.Add("txt");
|
|
|
- extList.Add("xls");
|
|
|
- extList.Add("xlsx");
|
|
|
- extList.Add("jpg");
|
|
|
- extList.Add("jpeg");
|
|
|
- extList.Add("png");
|
|
|
+ //旧
|
|
|
+ //extList.Add("txt");
|
|
|
+ //extList.Add("xls");
|
|
|
+ //extList.Add("xlsx");
|
|
|
+ //extList.Add("jpg");
|
|
|
+ //extList.Add("jpeg");
|
|
|
+ //extList.Add("png");
|
|
|
+ //extList.Add("doc");
|
|
|
+ //extList.Add("docx");
|
|
|
+ //extList.Add("rar");
|
|
|
+ //extList.Add("pdf");
|
|
|
+ //extList.Add("mp3");
|
|
|
+ //extList.Add("zip");
|
|
|
+ //extList.Add("wmv");
|
|
|
+ //extList.Add("mp4");
|
|
|
+ //extList.Add("svg");
|
|
|
+ //extList.Add("avi");
|
|
|
+ //新
|
|
|
extList.Add("doc");
|
|
|
- extList.Add("docx");
|
|
|
extList.Add("rar");
|
|
|
+ extList.Add("jpg");
|
|
|
extList.Add("pdf");
|
|
|
extList.Add("mp3");
|
|
|
+ extList.Add("xls");
|
|
|
+ extList.Add("xlsx");
|
|
|
extList.Add("zip");
|
|
|
+ extList.Add("docx");
|
|
|
extList.Add("wmv");
|
|
|
extList.Add("mp4");
|
|
|
+ extList.Add("png");
|
|
|
extList.Add("svg");
|
|
|
extList.Add("avi");
|
|
|
+ extList.Add("jpeg");
|
|
|
+ extList.Add("m4a");
|
|
|
+ extList.Add("txt");
|
|
|
+ extList.Add("wps");
|
|
|
+
|
|
|
//extList.Add("m4a");
|
|
|
if (!extList.Contains(ext))
|
|
|
{
|
|
|
// throw UserFriendlyException.SameMessage("文件格式不正确,只能上传【doc,rar,jpg,pdf,mp3,xls,xlsx,zip,docx,wmv,mp4.png,svg,avijpeg.m4a.txt】格式文件");
|
|
|
- throw UserFriendlyException.SameMessage("文件格式不正确,只能上传【doc,rar,jpg,pdf,mp3,xls,xlsx,zip,docx,wmv,mp4.png,svg,avi,jpeg,txt】格式文件");
|
|
|
+ throw UserFriendlyException.SameMessage("文件格式不正确,只能上传【doc,rar,jpg,pdf,mp3,xls,xlsx,zip,docx,wmv,mp4,png,svg,avi,jpeg,m4a,txt,wps】格式文件");
|
|
|
}
|
|
|
}
|
|
|
var filename = $"{Guid.NewGuid().ToString().Replace("-", string.Empty)}.{ext}";
|