From e411302bca8857e102443a5250c82b9580ef07a3 Mon Sep 17 00:00:00 2001
From: duheng <2286773002@qq.com>
Date: 星期五, 28 三月 2025 10:49:48 +0800
Subject: [PATCH] 修改成套设备增加逻辑

---
 WebApi/HStation.WebApi.TransferFile.Core/Startup.cs |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs b/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs
index 70deda0..82c51b0 100644
--- a/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs
+++ b/WebApi/HStation.WebApi.TransferFile.Core/Startup.cs
@@ -4,6 +4,7 @@
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Mvc.Controllers;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
 using Microsoft.Extensions.DependencyInjection;
@@ -30,11 +31,23 @@
 
             services.Configure<KestrelServerOptions>(options =>
             {
-                options.Limits.MaxRequestBodySize = int.MaxValue;
+                options.Limits.MaxRequestBodySize = int.MaxValue;//涔嬪墠鐨�
+                options.Limits.MaxRequestBufferSize = int.MaxValue;
+                options.Limits.MaxResponseBufferSize = int.MaxValue;
+
             });
             services.Configure<IISServerOptions>(options =>
             {
-                options.MaxRequestBodySize = int.MaxValue;
+                options.MaxRequestBodySize = int.MaxValue;//涔嬪墠鐨�
+                options.MaxRequestBodyBufferSize = int.MaxValue;
+            });
+            //瑙e喅Multipart body length limit 134217728 exceeded
+            services.Configure<FormOptions>(x =>
+            {
+                x.ValueLengthLimit = int.MaxValue;
+                x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart
+                x.MultipartBoundaryLengthLimit = int.MaxValue;
+                x.BufferBodyLengthLimit = int.MaxValue;
             });
 
             // services.AddJwt<JwtHandler>(enableGlobalAuthorize: true);

--
Gitblit v1.9.3