Browse Source

上传excel 文件contenttype 类型添加

yuqian 8 years ago
parent
commit
0bbfc6d35b

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

@@ -1164,7 +1164,7 @@ namespace CallCenterApi.Interface.Controllers.callout
1164 1164
             if (Request.Files.Count <= 0)
1165 1165
                 return Error("请正确上传Excel文件");
1166 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 1168
                 return Error($"请正确上传Excel文件:file.ContentType={file.ContentType}");
1169 1169
             var filePath = "";
1170 1170
             NPOIHelper npoi = new NPOIHelper();