Просмотр исходного кода

上传excel 文件contenttype 类型添加

yuqian лет назад: 8
Родитель
Сommit
0bbfc6d35b

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

1164
             if (Request.Files.Count <= 0)
1164
             if (Request.Files.Count <= 0)
1165
                 return Error("请正确上传Excel文件");
1165
                 return Error("请正确上传Excel文件");
1166
             var file = Request.Files[0];
1166
             var file = Request.Files[0];
1167
-            if (!file.ContentType.Equals("application/vnd.ms-excel") && !file.ContentType.Equals("application/x-xls") && !file.ContentType.Equals("application/x-xlsx") && !file.ContentType.Equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
1167
+            if (!file.ContentType.Equals("application/vnd.ms-excel") && !file.ContentType.Equals("application/x-xls") && !file.ContentType.Equals("application/x-xlsx") && !file.ContentType.Equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") && !file.ContentType.Equals("application/octet-stream"))
1168
                 return Error($"请正确上传Excel文件:file.ContentType={file.ContentType}");
1168
                 return Error($"请正确上传Excel文件:file.ContentType={file.ContentType}");
1169
             var filePath = "";
1169
             var filePath = "";
1170
             NPOIHelper npoi = new NPOIHelper();
1170
             NPOIHelper npoi = new NPOIHelper();