Sfoglia il codice sorgente

xls:上传导出json文件

xulisong 5 anni fa
parent
commit
10699b4cd9

+ 4 - 5
Executer/DataExport/RevitToJBim/MbiExport.cs

@@ -40,14 +40,13 @@ namespace RevitToJBim
                  */
                 var result = BimJsonUtil.Serializer(mbiDocument);
                 var resultResponse = UploadService.UploadExportFile(result);
-                string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
-                string path = Path.Combine(@"D:\", $"{fileName}.json");
-                File.WriteAllText(path, resultResponse.ToString());
-                System.Diagnostics.Process.Start("notepad.exe", path);
+                //string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
+                //string path = Path.Combine(@"D:\", $"{fileName}.json");
+                //File.WriteAllText(path, resultResponse.ToString());
+                //System.Diagnostics.Process.Start("notepad.exe", path);
             }
             catch (Exception ex)
             {
-
                 Console.WriteLine(ex.StackTrace.ToString());
             }
         }

+ 2 - 1
Executer/MBIRevitBase/Tools/HttpUtils.cs

@@ -39,7 +39,8 @@ namespace MBIRevitBase.Tools
                 MultipartFormDataContent content = new MultipartFormDataContent(boundary);
                 #region Stream请求
                 var streamContent = new StreamContent(stream);
-                content.Add(streamContent, "file");
+                //"file.zip"必须有,它的格式可能影响到内部的一些配置
+                content.Add(streamContent, "file","file.zip");
                 #endregion
                 var result = client.PostAsync(url, content).Result;
                 try