{"id":75766,"date":"2026-02-13T05:43:09","date_gmt":"2026-02-12T21:43:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/75766.html"},"modified":"2026-02-13T05:43:09","modified_gmt":"2026-02-12T21:43:09","slug":"%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e5%a4%a7%e5%b0%8f%e8%b6%85%e8%bf%87%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%99%90%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/75766.html","title":{"rendered":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236"},"content":{"rendered":"<p id=\"uc5c1a1cc\">\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 \u7684\u95ee\u9898\u3002\u9519\u8bef\u4fe1\u606f\u663e\u793a\u8bf7\u6c42\u5927\u5c0f\u8d85\u8fc7\u4e86\u914d\u7f6e\u7684\u6700\u5927\u503c&#xff08;20MB&#xff09;\u3002<\/p>\n<p id=\"u1b6752c9\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1899\" id=\"stIBx\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260212214307-698e496b01fc1.png\" width=\"1786\" \/><\/p>\n<h2 id=\"sCdi6\">\u914d\u7f6e\u63a8\u8350\u503c<\/h2>\n<p id=\"u631dc0fe\">\u6839\u636e\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f&#xff0c;\u5efa\u8bae\u7684\u914d\u7f6e&#xff1a;<\/p>\n<table id=\"txyd3\">\n<tbody>\n<tr>\n<td>\n<p id=\"uc0896e05\">\u573a\u666f<\/p>\n<\/td>\n<td>\n<p id=\"ua07361f1\">max-file-size<\/p>\n<\/td>\n<td>\n<p id=\"ua72692ba\">max-request-size<\/p>\n<\/td>\n<td>\n<p id=\"u09d6eb11\">\u8bf4\u660e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"u0dfea937\">\u666e\u901a\u8868\u5355<\/p>\n<\/td>\n<td>\n<p id=\"ubbcb82c3\">10MB<\/p>\n<\/td>\n<td>\n<p id=\"ude85af5d\">20MB<\/p>\n<\/td>\n<td>\n<p id=\"uc3d7abdf\">\u666e\u901a\u7528\u6237\u4e0a\u4f20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"ua8523480\">\u56fe\u7247\u5206\u4eab<\/p>\n<\/td>\n<td>\n<p id=\"uce430985\">20MB<\/p>\n<\/td>\n<td>\n<p id=\"udc0ba672\">50MB<\/p>\n<\/td>\n<td>\n<p id=\"uf423ae2f\">\u56fe\u7247\u3001\u5934\u50cf\u4e0a\u4f20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"ue857eeac\">\u6587\u6863\u7cfb\u7edf<\/p>\n<\/td>\n<td>\n<p id=\"ubde5c33f\">100MB<\/p>\n<\/td>\n<td>\n<p id=\"ubc6b3966\">200MB<\/p>\n<\/td>\n<td>\n<p id=\"uf175253c\">PDF\u3001\u6587\u6863\u4e0a\u4f20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"uf11f3ffe\">\u89c6\u9891\u4e0a\u4f20<\/p>\n<\/td>\n<td>\n<p id=\"u0e0c8d6d\">500MB<\/p>\n<\/td>\n<td>\n<p id=\"u7f5c392b\">1GB<\/p>\n<\/td>\n<td>\n<p id=\"u5a0282b6\">\u5c0f\u89c6\u9891\u4e0a\u4f20<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"1f325483\">\u5b8c\u6574\u7684\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u9650\u5236\u89e3\u51b3\u65b9\u6848<\/h2>\n<h3 id=\"53d59cb1\">\u95ee\u9898\u8bca\u65ad<\/h3>\n<p id=\"uf6a9dddf\">\u4ece\u56fe\u7247\u4e2d\u7684\u9519\u8bef\u4fe1\u606f\u53ef\u4ee5\u770b\u5230&#xff1a;<\/p>\n<p>Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: io.undertow.server.RequestTooBigException:<br \/>\nUT000020: Connection terminated as request was larger than 20971520 <\/p>\n<p id=\"ude7ab22d\">\u5173\u952e\u4fe1\u606f\u5206\u6790&#xff1a;<\/p>\n<ul>\n<li id=\"u27cbfc39\">\u9519\u8bef\u7c7b\u578b&#xff1a;RequestTooBigException&#xff08;\u8bf7\u6c42\u8fc7\u5927\u5f02\u5e38&#xff09;<\/li>\n<li id=\"u1a285e2e\">\u5b9e\u9645\u9650\u5236&#xff1a;20971520\u5b57\u8282 &#061; 20MB<\/li>\n<li id=\"ub04553f6\">\u670d\u52a1\u5668\u7c7b\u578b&#xff1a;Undertow&#xff08;Spring Boot \u9ed8\u8ba4\u5185\u5d4c\u670d\u52a1\u5668\u4e4b\u4e00&#xff09;<\/li>\n<li id=\"u182c6c8a\">\u95ee\u9898\u4f4d\u7f6e&#xff1a;\u8bf7\u6c42\u5728\u5230\u8fbe\u5e94\u7528\u4ee3\u7801\u4e4b\u524d\u5c31\u88ab\u670d\u52a1\u5668\u62e6\u622a\u4e86<\/li>\n<\/ul>\n<h3 id=\"9318c5a9\">\u5b8c\u6574\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4 id=\"d353b318\">\u7b2c\u4e00\u90e8\u5206&#xff1a;\u540e\u7aefSpring Boot\u5e94\u7528\u914d\u7f6e<\/h4>\n<h5 id=\"0d9e2e24\">1. \u4fee\u6539Spring Boot\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p id=\"u7512220e\">application.properties&#xff08;\u63a8\u8350&#xff09;<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u6587\u4ef6\u4e0a\u4f20\u914d\u7f6e &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# \u5355\u4e2a\u6587\u4ef6\u7684\u6700\u5927\u5927\u5c0f&#xff08;\u9ed8\u8ba41MB&#xff09;<br \/>\nspring.servlet.multipart.max-file-size&#061;50MB<\/p>\n<p># \u6574\u4e2a\u8bf7\u6c42\u7684\u6700\u5927\u5927\u5c0f&#xff08;\u9ed8\u8ba410MB&#xff09;<br \/>\nspring.servlet.multipart.max-request-size&#061;100MB<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; Undertow\u670d\u52a1\u5668\u4e13\u7528\u914d\u7f6e &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# \u8fd9\u662f\u89e3\u51b3\u56fe\u4e2d\u9519\u8bef\u7684\u5173\u952e\u914d\u7f6e&#xff01;<br \/>\nserver.undertow.max-http-post-size&#061;100MB<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u5176\u4ed6\u53ef\u9009\u4f18\u5316\u914d\u7f6e &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# \u8bbe\u7f6e\u4e34\u65f6\u6587\u4ef6\u5b58\u50a8\u4f4d\u7f6e&#xff08;\u53ef\u9009&#xff09;<br \/>\nspring.servlet.multipart.location&#061;\/tmp<\/p>\n<p># \u662f\u5426\u5ef6\u8fdf\u89e3\u6790&#xff08;\u5927\u6587\u4ef6\u5efa\u8bae\u8bbe\u4e3atrue&#xff09;<br \/>\nspring.servlet.multipart.resolve-lazily&#061;false <\/p>\n<p id=\"u921e9c6c\">application.yml<\/p>\n<p>spring:<br \/>\n  servlet:<br \/>\n    multipart:<br \/>\n      max-file-size: 50MB<br \/>\n      max-request-size: 100MB<br \/>\n      location: \/tmp<br \/>\n      resolve-lazily: false<\/p>\n<p>server:<br \/>\n  undertow:<br \/>\n    max-http-post-size: 100MB <\/p>\n<h5 id=\"f153ba17\">2. \u521b\u5efa\u914d\u7f6e\u9a8c\u8bc1\u63a5\u53e3&#xff08;\u53ef\u9009\u4f46\u63a8\u8350&#xff09;<\/h5>\n<p>import org.springframework.beans.factory.annotation.Value;<br \/>\nimport org.springframework.web.bind.annotation.GetMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>&#064;RestController<br \/>\npublic class ConfigInfoController {<\/p>\n<p>    &#064;Value(&#034;${spring.servlet.multipart.max-file-size}&#034;)<br \/>\n    private String maxFileSize;<\/p>\n<p>    &#064;Value(&#034;${spring.servlet.multipart.max-request-size}&#034;)<br \/>\n    private String maxRequestSize;<\/p>\n<p>    &#064;Value(&#034;${server.undertow.max-http-post-size}&#034;)<br \/>\n    private String undertowMaxPostSize;<\/p>\n<p>    &#064;GetMapping(&#034;\/config\/info&#034;)<br \/>\n    public String getConfigInfo() {<br \/>\n        return String.format(<br \/>\n            &#034;\u5f53\u524d\u6587\u4ef6\u4e0a\u4f20\u914d\u7f6e&#xff1a;&lt;br&gt;&#034; &#043;<br \/>\n            &#034;\u2022 Spring Multipart \u5355\u4e2a\u6587\u4ef6\u6700\u5927&#xff1a;%s&lt;br&gt;&#034; &#043;<br \/>\n            &#034;\u2022 Spring Multipart \u8bf7\u6c42\u6700\u5927&#xff1a;%s&lt;br&gt;&#034; &#043;<br \/>\n            &#034;\u2022 Undertow POST\u8bf7\u6c42\u6700\u5927&#xff1a;%s&lt;br&gt;&lt;br&gt;&#034; &#043;<br \/>\n            &#034;\u914d\u7f6e\u9a8c\u8bc1&#xff1a;%s&#034;,<br \/>\n            maxFileSize,<br \/>\n            maxRequestSize,<br \/>\n            undertowMaxPostSize,<br \/>\n            verifyConfig() ? &#034;\u2705 \u914d\u7f6e\u5408\u7406&#034; : &#034;\u26a0\ufe0f \u914d\u7f6e\u53ef\u80fd\u6709\u51b2\u7a81&#034;<br \/>\n        );<br \/>\n    }<\/p>\n<p>    private boolean verifyConfig() {<br \/>\n        \/\/ \u9a8c\u8bc1Undertow\u914d\u7f6e\u662f\u5426\u8db3\u591f\u5927<br \/>\n        long undertowSize &#061; parseSize(undertowMaxPostSize);<br \/>\n        long requestSize &#061; parseSize(maxRequestSize);<br \/>\n        return undertowSize &gt;&#061; requestSize;<br \/>\n    }<\/p>\n<p>    private long parseSize(String sizeStr) {<br \/>\n        \/\/ \u7b80\u5355\u89e3\u6790\u5927\u5c0f\u5b57\u7b26\u4e32&#xff0c;\u5b9e\u9645\u53ef\u4f7f\u7528\u66f4\u5b8c\u6574\u7684\u65b9\u6cd5<br \/>\n        if (sizeStr.endsWith(&#034;MB&#034;)) {<br \/>\n            return Long.parseLong(sizeStr.replace(&#034;MB&#034;, &#034;&#034;)) * 1024 * 1024;<br \/>\n        }<br \/>\n        return Long.parseLong(sizeStr);<br \/>\n    }<br \/>\n} <\/p>\n<h5 id=\"4eabbf9e\">3. \u6dfb\u52a0\u5168\u5c40\u5f02\u5e38\u5904\u7406\u5668<\/h5>\n<p>import org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<br \/>\nimport org.springframework.http.HttpStatus;<br \/>\nimport org.springframework.http.ResponseEntity;<br \/>\nimport org.springframework.web.bind.annotation.ControllerAdvice;<br \/>\nimport org.springframework.web.bind.annotation.ExceptionHandler;<br \/>\nimport org.springframework.web.multipart.MaxUploadSizeExceededException;<br \/>\nimport io.undertow.server.RequestTooBigException;<\/p>\n<p>&#064;ControllerAdvice<br \/>\npublic class FileUploadExceptionHandler {<\/p>\n<p>    private static final Logger logger &#061; LoggerFactory.getLogger(FileUploadExceptionHandler.class);<\/p>\n<p>    &#064;ExceptionHandler({<br \/>\n        MaxUploadSizeExceededException.class,<br \/>\n        RequestTooBigException.class,<br \/>\n        IllegalStateException.class<br \/>\n        })<br \/>\n    public ResponseEntity&lt;ApiResponse&gt; handleFileSizeException(Exception ex) {<\/p>\n<p>        \/\/ \u8bb0\u5f55\u8be6\u7ec6\u9519\u8bef\u65e5\u5fd7<br \/>\n        logger.error(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u5f02\u5e38 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<br \/>\n        logger.error(&#034;\u5f02\u5e38\u7c7b\u578b: &#034; &#043; ex.getClass().getName());<br \/>\n        logger.error(&#034;\u5f02\u5e38\u4fe1\u606f: &#034; &#043; ex.getMessage());<br \/>\n        logger.error(&#034;\u5806\u6808\u8ddf\u8e2a:&#034;, ex);<br \/>\n        logger.error(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<\/p>\n<p>        \/\/ \u6839\u636e\u5f02\u5e38\u7c7b\u578b\u63d0\u4f9b\u66f4\u5177\u4f53\u7684\u9519\u8bef\u4fe1\u606f<br \/>\n        String userMessage;<br \/>\n        String techMessage &#061; ex.getMessage();<\/p>\n<p>        if (ex instanceof RequestTooBigException) {<br \/>\n            userMessage &#061; &#034;\u4e0a\u4f20\u5931\u8d25&#xff1a;\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236&#xff08;\u5f53\u524d\u6700\u592720MB&#xff09;&#034;;<br \/>\n        } else if (ex instanceof MaxUploadSizeExceededException) {<br \/>\n            userMessage &#061; &#034;\u4e0a\u4f20\u5931\u8d25&#xff1a;\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u5e94\u7528\u9650\u5236&#034;;<br \/>\n        } else if (ex.getMessage() !&#061; null &amp;&amp; ex.getMessage().contains(&#034;was larger than&#034;)) {<br \/>\n            userMessage &#061; &#034;\u4e0a\u4f20\u5931\u8d25&#xff1a;\u8bf7\u6c42\u4f53\u5927\u5c0f\u8d85\u51fa\u9650\u5236&#034;;<br \/>\n        } else {<br \/>\n            userMessage &#061; &#034;\u4e0a\u4f20\u5931\u8d25&#xff1a;\u6587\u4ef6\u5904\u7406\u5f02\u5e38&#034;;<br \/>\n        }<\/p>\n<p>        \/\/ \u8fd4\u56de\u6807\u51c6\u5316\u9519\u8bef\u54cd\u5e94<br \/>\n        ApiResponse response &#061; ApiResponse.error(<br \/>\n            HttpStatus.PAYLOAD_TOO_LARGE.value(),<br \/>\n            userMessage,<br \/>\n            techMessage<br \/>\n        );<\/p>\n<p>        return ResponseEntity<br \/>\n        .status(HttpStatus.PAYLOAD_TOO_LARGE)<br \/>\n        .body(response);<br \/>\n    }<\/p>\n<p>    \/\/ \u7edf\u4e00\u54cd\u5e94\u683c\u5f0f<br \/>\n    public static class ApiResponse {<br \/>\n        private int code;<br \/>\n        private String message;<br \/>\n        private String detail;<br \/>\n        private Object data;<\/p>\n<p>        \/\/ \u6784\u9020\u65b9\u6cd5\u3001getter\/setter \u7701\u7565<\/p>\n<p>        public static ApiResponse error(int code, String message, String detail) {<br \/>\n            ApiResponse response &#061; new ApiResponse();<br \/>\n            response.setCode(code);<br \/>\n            response.setMessage(message);<br \/>\n            response.setDetail(detail);<br \/>\n            return response;<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"adb9d7b7\">\u7b2c\u4e8c\u90e8\u5206&#xff1a;Nginx\u4ee3\u7406\u914d\u7f6e&#xff08;\u5982\u679c\u4f7f\u7528&#xff09;<\/h4>\n<p id=\"u4e1b4d3c\">\u5982\u679c\u60a8\u7684\u5e94\u7528\u524d\u9762\u6709Nginx\u4ee3\u7406&#xff0c;\u5fc5\u987b\u540c\u65f6\u914d\u7f6eNginx&#xff1a;<\/p>\n<h5 id=\"44c39ac4\">1. \u4fee\u6539Nginx\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p># \/etc\/nginx\/nginx.conf \u6216\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6<br \/>\nhttp {<br \/>\n    # \u9ed8\u8ba4\u7684\u5ba2\u6237\u7aef\u8bf7\u6c42\u4f53\u5927\u5c0f\u9650\u5236&#xff08;\u9ed8\u8ba41MB&#xff09;<br \/>\n    client_max_body_size 100M;<\/p>\n<p>    # \u5176\u4ed6http\u914d\u7f6e&#8230;<br \/>\n}<\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name your-domain.com;<\/p>\n<p>    # \u9488\u5bf9\u5f53\u524dserver\u7684\u914d\u7f6e&#xff08;\u4f1a\u8986\u76d6http\u5757\u4e2d\u7684\u8bbe\u7f6e&#xff09;<br \/>\n    client_max_body_size 100M;<\/p>\n<p>    # \u4e0a\u4f20\u63a5\u53e3\u7684\u7279\u6b8a\u914d\u7f6e&#xff08;\u5982\u679c\u4e0a\u4f20\u8def\u5f84\u56fa\u5b9a&#xff09;<br \/>\n    location \/api\/upload {<br \/>\n        # \u53ef\u4ee5\u5355\u72ec\u4e3a\u4e0a\u4f20\u63a5\u53e3\u8bbe\u7f6e\u66f4\u5927\u7684\u9650\u5236<br \/>\n        client_max_body_size 200M;<\/p>\n<p>        # \u589e\u52a0\u8d85\u65f6\u65f6\u95f4&#xff08;\u5927\u6587\u4ef6\u4e0a\u4f20\u9700\u8981&#xff09;<br \/>\n        proxy_connect_timeout 300s;<br \/>\n        proxy_send_timeout 300s;<br \/>\n        proxy_read_timeout 300s;<\/p>\n<p>        # \u4ee3\u7406\u5230\u540e\u7aef\u5e94\u7528<br \/>\n        proxy_pass http:\/\/localhost:8080;<br \/>\n        proxy_set_header Host $host;<br \/>\n        proxy_set_header X-Real-IP $remote_addr;<br \/>\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n        proxy_set_header X-Forwarded-Proto $scheme;<br \/>\n    }<\/p>\n<p>    # \u5176\u4ed6location\u914d\u7f6e&#8230;<br \/>\n    location \/ {<br \/>\n        proxy_pass http:\/\/localhost:8080;<br \/>\n        # \u5176\u4ed6\u4ee3\u7406\u8bbe\u7f6e&#8230;<br \/>\n    }<br \/>\n} <\/p>\n<h5 id=\"b65067e7\">2. \u9a8c\u8bc1\u5e76\u91cd\u542fNginx<\/h5>\n<p># 1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u8bed\u6cd5<br \/>\nsudo nginx -t<\/p>\n<p># 2. \u5982\u679c\u8bed\u6cd5\u6b63\u786e&#xff0c;\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nsudo nginx -s reload<\/p>\n<p># \u6216\u91cd\u542fNginx\u670d\u52a1<br \/>\nsudo systemctl restart nginx<\/p>\n<p># 3. \u67e5\u770bNginx\u9519\u8bef\u65e5\u5fd7&#xff08;\u5982\u679c\u4ecd\u6709\u95ee\u9898&#xff09;<br \/>\nsudo tail -f \/var\/log\/nginx\/error.log <\/p>\n<h4 id=\"8a6fb0ac\">\u7b2c\u4e09\u90e8\u5206&#xff1a;\u524d\u7aef\u4f18\u5316\u914d\u7f6e<\/h4>\n<h5 id=\"fd292530\">1. HTML\u524d\u7aef\u9a8c\u8bc1<\/h5>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n    &lt;title&gt;\u6587\u4ef6\u4e0a\u4f20&lt;\/title&gt;<br \/>\n    &lt;style&gt;<br \/>\n        .file-input {<br \/>\n            padding: 10px;<br \/>\n            border: 2px dashed #ccc;<br \/>\n            border-radius: 5px;<br \/>\n            margin: 20px 0;<br \/>\n        }<br \/>\n        .error {<br \/>\n            color: #f00;<br \/>\n            margin-top: 5px;<br \/>\n        }<br \/>\n        .file-info {<br \/>\n            color: #666;<br \/>\n            font-size: 0.9em;<br \/>\n        }<br \/>\n    &lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n    &lt;h2&gt;\u6587\u4ef6\u4e0a\u4f20&lt;\/h2&gt;<\/p>\n<p>    &lt;form id&#061;&#034;uploadForm&#034; method&#061;&#034;post&#034; enctype&#061;&#034;multipart\/form-data&#034; action&#061;&#034;\/api\/upload&#034;&gt;<br \/>\n        &lt;div&gt;<br \/>\n            &lt;label for&#061;&#034;file&#034;&gt;\u9009\u62e9\u6587\u4ef6&#xff1a;&lt;\/label&gt;<br \/>\n            &lt;input type&#061;&#034;file&#034; id&#061;&#034;file&#034; name&#061;&#034;file&#034; class&#061;&#034;file-input&#034;<br \/>\n                   accept&#061;&#034;.jpg,.jpeg,.png,.pdf,.doc,.docx,.xls,.xlsx&#034;&gt;<br \/>\n        &lt;\/div&gt;<\/p>\n<p>        &lt;div id&#061;&#034;fileInfo&#034; class&#061;&#034;file-info&#034;&gt;&lt;\/div&gt;<br \/>\n        &lt;div id&#061;&#034;errorMsg&#034; class&#061;&#034;error&#034;&gt;&lt;\/div&gt;<\/p>\n<p>        &lt;button type&#061;&#034;submit&#034; id&#061;&#034;submitBtn&#034;&gt;\u4e0a\u4f20\u6587\u4ef6&lt;\/button&gt;<br \/>\n    &lt;\/form&gt;<\/p>\n<p>    &lt;script&gt;<br \/>\n        const MAX_FILE_SIZE &#061; 20 * 1024 * 1024; \/\/ 20MB<\/p>\n<p>        document.getElementById(&#039;file&#039;).addEventListener(&#039;change&#039;, function(e) {<br \/>\n            const file &#061; e.target.files[0];<br \/>\n            const errorDiv &#061; document.getElementById(&#039;errorMsg&#039;);<br \/>\n            const infoDiv &#061; document.getElementById(&#039;fileInfo&#039;);<\/p>\n<p>            \/\/ \u6e05\u7a7a\u4e4b\u524d\u7684\u63d0\u793a<br \/>\n            errorDiv.textContent &#061; &#039;&#039;;<br \/>\n            infoDiv.textContent &#061; &#039;&#039;;<\/p>\n<p>            if (!file) return;<\/p>\n<p>            \/\/ \u663e\u793a\u6587\u4ef6\u4fe1\u606f<br \/>\n            const fileSizeMB &#061; (file.size \/ (1024 * 1024)).toFixed(2);<br \/>\n            infoDiv.textContent &#061; &#096;\u6587\u4ef6: ${file.name} (${fileSizeMB} MB)&#096;;<\/p>\n<p>            \/\/ \u68c0\u67e5\u6587\u4ef6\u5927\u5c0f<br \/>\n            if (file.size &gt; MAX_FILE_SIZE) {<br \/>\n                const maxSizeMB &#061; (MAX_FILE_SIZE \/ (1024 * 1024)).toFixed(0);<br \/>\n                errorDiv.textContent &#061; &#096;\u9519\u8bef&#xff1a;\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ${maxSizeMB}MB&#096;;<br \/>\n                e.target.value &#061; &#039;&#039;; \/\/ \u6e05\u7a7a\u9009\u62e9<br \/>\n                infoDiv.textContent &#061; &#039;&#039;;<br \/>\n            }<br \/>\n        });<\/p>\n<p>        \/\/ \u8868\u5355\u63d0\u4ea4\u524d\u518d\u6b21\u9a8c\u8bc1<br \/>\n        document.getElementById(&#039;uploadForm&#039;).addEventListener(&#039;submit&#039;, function(e) {<br \/>\n            const fileInput &#061; document.getElementById(&#039;file&#039;);<br \/>\n            const errorDiv &#061; document.getElementById(&#039;errorMsg&#039;);<\/p>\n<p>            if (!fileInput.files[0]) {<br \/>\n                errorDiv.textContent &#061; &#039;\u8bf7\u9009\u62e9\u8981\u4e0a\u4f20\u7684\u6587\u4ef6&#039;;<br \/>\n                e.preventDefault();<br \/>\n                return false;<br \/>\n            }<\/p>\n<p>            if (fileInput.files[0].size &gt; MAX_FILE_SIZE) {<br \/>\n                errorDiv.textContent &#061; &#039;\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u9650\u5236&#xff0c;\u8bf7\u91cd\u65b0\u9009\u62e9&#039;;<br \/>\n                e.preventDefault();<br \/>\n                return false;<br \/>\n            }<\/p>\n<p>            \/\/ \u663e\u793a\u4e0a\u4f20\u4e2d\u72b6\u6001<br \/>\n            const submitBtn &#061; document.getElementById(&#039;submitBtn&#039;);<br \/>\n            submitBtn.disabled &#061; true;<br \/>\n            submitBtn.textContent &#061; &#039;\u4e0a\u4f20\u4e2d&#8230;&#039;;<\/p>\n<p>            return true;<br \/>\n        });<br \/>\n    &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt; <\/p>\n<h5 id=\"806903e6\">2. React\u7ec4\u4ef6\u793a\u4f8b&#xff08;\u5982\u679c\u4f7f\u7528React&#xff09;<\/h5>\n<p>import React, { useState } from &#039;react&#039;;<br \/>\nimport axios from &#039;axios&#039;;<\/p>\n<p>const FileUploadComponent &#061; () &#061;&gt; {<br \/>\n    const [file, setFile] &#061; useState(null);<br \/>\n    const [error, setError] &#061; useState(&#039;&#039;);<br \/>\n    const [uploading, setUploading] &#061; useState(false);<br \/>\n    const [progress, setProgress] &#061; useState(0);<\/p>\n<p>    const MAX_SIZE &#061; 20 * 1024 * 1024; \/\/ 20MB<\/p>\n<p>    const handleFileChange &#061; (e) &#061;&gt; {<br \/>\n        const selectedFile &#061; e.target.files[0];<br \/>\n        setError(&#039;&#039;);<\/p>\n<p>        if (!selectedFile) return;<\/p>\n<p>        \/\/ \u68c0\u67e5\u6587\u4ef6\u5927\u5c0f<br \/>\n        if (selectedFile.size &gt; MAX_SIZE) {<br \/>\n            setError(&#096;\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ${MAX_SIZE \/ (1024 * 1024)}MB&#096;);<br \/>\n            setFile(null);<br \/>\n            e.target.value &#061; &#039;&#039;;<br \/>\n            return;<br \/>\n        }<\/p>\n<p>        setFile(selectedFile);<br \/>\n    };<\/p>\n<p>    const handleUpload &#061; async () &#061;&gt; {<br \/>\n        if (!file) {<br \/>\n            setError(&#039;\u8bf7\u5148\u9009\u62e9\u6587\u4ef6&#039;);<br \/>\n            return;<br \/>\n        }<\/p>\n<p>        const formData &#061; new FormData();<br \/>\n        formData.append(&#039;file&#039;, file);<\/p>\n<p>        try {<br \/>\n            setUploading(true);<br \/>\n            setProgress(0);<\/p>\n<p>            const response &#061; await axios.post(&#039;\/api\/upload&#039;, formData, {<br \/>\n                headers: {<br \/>\n                    &#039;Content-Type&#039;: &#039;multipart\/form-data&#039;<br \/>\n                },<br \/>\n                onUploadProgress: (progressEvent) &#061;&gt; {<br \/>\n                    const percent &#061; Math.round(<br \/>\n                        (progressEvent.loaded * 100) \/ progressEvent.total<br \/>\n                    );<br \/>\n                    setProgress(percent);<br \/>\n                }<br \/>\n            });<\/p>\n<p>            alert(&#039;\u4e0a\u4f20\u6210\u529f&#xff01;&#039;);<br \/>\n            setFile(null);<br \/>\n            setProgress(0);<\/p>\n<p>        } catch (err) {<br \/>\n            if (err.response &amp;&amp; err.response.status &#061;&#061;&#061; 413) {<br \/>\n                setError(&#039;\u6587\u4ef6\u592a\u5927&#xff0c;\u8bf7\u538b\u7f29\u540e\u91cd\u65b0\u4e0a\u4f20&#039;);<br \/>\n            } else {<br \/>\n                setError(&#039;\u4e0a\u4f20\u5931\u8d25: &#039; &#043; (err.response?.data?.message || err.message));<br \/>\n            }<br \/>\n        } finally {<br \/>\n            setUploading(false);<br \/>\n        }<br \/>\n    };<\/p>\n<p>    return (<br \/>\n        &lt;div&gt;<br \/>\n            &lt;input type&#061;&#034;file&#034; onChange&#061;{handleFileChange} disabled&#061;{uploading} \/&gt;<br \/>\n            {file &amp;&amp; (<br \/>\n                &lt;div&gt;<br \/>\n                    &lt;p&gt;\u5df2\u9009\u62e9: {file.name} ({(file.size \/ (1024 * 1024)).toFixed(2)} MB)&lt;\/p&gt;<br \/>\n                &lt;\/div&gt;<br \/>\n            )}<br \/>\n            {error &amp;&amp; &lt;div style&#061;{{color: &#039;red&#039;}}&gt;{error}&lt;\/div&gt;}<br \/>\n            {uploading &amp;&amp; (<br \/>\n                &lt;div&gt;<br \/>\n                    &lt;progress value&#061;{progress} max&#061;&#034;100&#034; \/&gt;<br \/>\n                    &lt;span&gt;{progress}%&lt;\/span&gt;<br \/>\n                &lt;\/div&gt;<br \/>\n            )}<br \/>\n            &lt;button onClick&#061;{handleUpload} disabled&#061;{uploading || !file}&gt;<br \/>\n                {uploading ? &#039;\u4e0a\u4f20\u4e2d&#8230;&#039; : &#039;\u4e0a\u4f20\u6587\u4ef6&#039;}<br \/>\n            &lt;\/button&gt;<br \/>\n        &lt;\/div&gt;<br \/>\n    );<br \/>\n}; <\/p>\n<h4 id=\"0c755eb7\">\u7b2c\u56db\u90e8\u5206&#xff1a;\u9a8c\u8bc1\u548c\u6d4b\u8bd5<\/h4>\n<h5 id=\"5b95b572\">1. \u521b\u5efa\u6d4b\u8bd5\u63a5\u53e3<\/h5>\n<p>import org.springframework.web.bind.annotation.*;<br \/>\nimport org.springframework.web.multipart.MultipartFile;<br \/>\nimport java.io.IOException;<\/p>\n<p>&#064;RestController<br \/>\n&#064;RequestMapping(&#034;\/api\/test&#034;)<br \/>\npublic class UploadTestController {<\/p>\n<p>    &#064;PostMapping(&#034;\/upload&#034;)<br \/>\n    public String testUpload(<br \/>\n            &#064;RequestParam(&#034;file&#034;) MultipartFile file,<br \/>\n            &#064;RequestParam(value &#061; &#034;chunk&#034;, required &#061; false) Integer chunk,<br \/>\n            &#064;RequestParam(value &#061; &#034;chunks&#034;, required &#061; false) Integer chunks) {<\/p>\n<p>        System.out.println(&#034;&#061;&#061;&#061; \u6587\u4ef6\u4e0a\u4f20\u6d4b\u8bd5 &#061;&#061;&#061;&#034;);<br \/>\n        System.out.println(&#034;\u6587\u4ef6\u540d: &#034; &#043; file.getOriginalFilename());<br \/>\n        System.out.println(&#034;\u6587\u4ef6\u5927\u5c0f: &#034; &#043; file.getSize() &#043; &#034; \u5b57\u8282&#034;);<br \/>\n        System.out.println(&#034;\u6587\u4ef6\u7c7b\u578b: &#034; &#043; file.getContentType());<\/p>\n<p>        if (chunk !&#061; null &amp;&amp; chunks !&#061; null) {<br \/>\n            System.out.println(&#034;\u5206\u7247\u4e0a\u4f20: &#034; &#043; (chunk &#043; 1) &#043; &#034;\/&#034; &#043; chunks);<br \/>\n        }<\/p>\n<p>        \/\/ \u8fd4\u56de\u4e0a\u4f20\u4fe1\u606f<br \/>\n        return String.format(<br \/>\n            &#034;\u4e0a\u4f20\u6210\u529f&#xff01;\\\\n&#034; &#043;<br \/>\n            &#034;\u6587\u4ef6\u540d: %s\\\\n&#034; &#043;<br \/>\n            &#034;\u5927\u5c0f: %.2f MB\\\\n&#034; &#043;<br \/>\n            &#034;\u7c7b\u578b: %s&#034;,<br \/>\n            file.getOriginalFilename(),<br \/>\n            file.getSize() \/ (1024.0 * 1024.0),<br \/>\n            file.getContentType()<br \/>\n        );<br \/>\n    }<\/p>\n<p>    &#064;GetMapping(&#034;\/limits&#034;)<br \/>\n    public String getLimits() {<br \/>\n        return &#034;\u5f53\u524d\u6d4b\u8bd5\u63a5\u53e3\u53ef\u7528&#xff0c;\u8bf7\u4f7f\u7528Postman\u6216\u524d\u7aef\u9875\u9762\u4e0a\u4f20\u6587\u4ef6\u8fdb\u884c\u6d4b\u8bd5&#034;;<br \/>\n    }<br \/>\n} <\/p>\n<h5 id=\"8a1b4287\">2. \u4f7f\u7528Postman\u6d4b\u8bd5<\/h5>\n<li id=\"u83982b04\">\u521b\u5efa\u8bf7\u6c42&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u3e093e6b\">Method: POST<\/li>\n<li id=\"u86365697\">URL: http:\/\/localhost:8080\/api\/test\/upload<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li id=\"u928a7c75\">\u8bbe\u7f6eBody&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u68a5cc31\">\u9009\u62e9 form-data<\/li>\n<li id=\"uaf3393df\">Key: file(\u7c7b\u578b\u9009\u62e9 File)<\/li>\n<li id=\"uf23aeaa4\">Value: \u9009\u62e9\u4e00\u4e2a\u5927\u6587\u4ef6&#xff08;\u598230MB\u7684\u6d4b\u8bd5\u6587\u4ef6&#xff09;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li id=\"u9943a7bb\">\u89c2\u5bdf\u7ed3\u679c&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u978f0e90\">\u5982\u679c\u914d\u7f6e\u6b63\u786e&#xff0c;\u5e94\u8be5\u80fd\u6210\u529f\u4e0a\u4f20<\/li>\n<li id=\"u168f3a46\">\u5982\u679c\u8fd8\u6709\u95ee\u9898&#xff0c;\u67e5\u770b\u63a7\u5236\u53f0\u65e5\u5fd7<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"7c0a2a08\">\u7b2c\u4e94\u90e8\u5206&#xff1a;\u751f\u4ea7\u73af\u5883\u6ce8\u610f\u4e8b\u9879<\/h4>\n<h5 id=\"60cb4e26\">1. \u5b89\u5168\u8003\u8651<\/h5>\n<p># \u9650\u5236\u4e0a\u4f20\u6587\u4ef6\u7c7b\u578b<br \/>\nspring.servlet.multipart.allowed-file-extensions&#061;.jpg,.jpeg,.png,.pdf,.doc,.docx<\/p>\n<p># \u8bbe\u7f6e\u6587\u4ef6\u5b58\u50a8\u5b89\u5168\u7b56\u7565<br \/>\n# \u907f\u514d\u4e0a\u4f20\u53ef\u6267\u884c\u6587\u4ef6\u7b49\u5371\u9669\u7c7b\u578b <\/p>\n<h5 id=\"d65fc8fe\">2. \u5927\u6587\u4ef6\u4e0a\u4f20\u4f18\u5316<\/h5>\n<p>\/\/ \u5bf9\u4e8e\u8d85\u5927\u6587\u4ef6&#xff0c;\u5efa\u8bae\u4f7f\u7528\u5206\u7247\u4e0a\u4f20<br \/>\n\/\/ 1. \u524d\u7aef\u5c06\u6587\u4ef6\u5206\u6210\u591a\u4e2a\u5c0f\u5757<br \/>\n\/\/ 2. \u540e\u7aef\u6309\u987a\u5e8f\u63a5\u6536\u5e76\u5408\u5e76<br \/>\n\/\/ 3. \u63d0\u4f9b\u65ad\u70b9\u7eed\u4f20\u529f\u80fd<\/p>\n<p>&#064;RestController<br \/>\n&#064;RequestMapping(&#034;\/api\/chunk-upload&#034;)<br \/>\npublic class ChunkUploadController {<\/p>\n<p>    &#064;PostMapping(&#034;\/chunk&#034;)<br \/>\n    public ResponseEntity&lt;?&gt; uploadChunk(<br \/>\n            &#064;RequestParam(&#034;file&#034;) MultipartFile chunk,<br \/>\n            &#064;RequestParam(&#034;chunkNumber&#034;) int chunkNumber,<br \/>\n            &#064;RequestParam(&#034;totalChunks&#034;) int totalChunks,<br \/>\n            &#064;RequestParam(&#034;identifier&#034;) String identifier) {<br \/>\n        \/\/ \u5b9e\u73b0\u5206\u7247\u4e0a\u4f20\u903b\u8f91<br \/>\n        return ResponseEntity.ok().body(&#034;\u5206\u7247\u4e0a\u4f20\u6210\u529f&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<h5 id=\"6a9ae1eb\">3. \u76d1\u63a7\u548c\u544a\u8b66<\/h5>\n<p>\/\/ \u6dfb\u52a0\u6587\u4ef6\u4e0a\u4f20\u76d1\u63a7<br \/>\n&#064;Component<br \/>\npublic class UploadMetrics {<\/p>\n<p>    private final MeterRegistry meterRegistry;<\/p>\n<p>    public UploadMetrics(MeterRegistry meterRegistry) {<br \/>\n        this.meterRegistry &#061; meterRegistry;<br \/>\n    }<\/p>\n<p>    public void recordUpload(String filename, long size, boolean success) {<br \/>\n        \/\/ \u8bb0\u5f55\u4e0a\u4f20\u6307\u6807<br \/>\n        meterRegistry.counter(&#034;file.upload.count&#034;).increment();<br \/>\n        meterRegistry.summary(&#034;file.upload.size&#034;).record(size);<\/p>\n<p>        if (!success) {<br \/>\n            meterRegistry.counter(&#034;file.upload.error&#034;).increment();<br \/>\n        }<\/p>\n<p>        \/\/ \u8bb0\u5f55\u5230\u65e5\u5fd7<br \/>\n        LoggerFactory.getLogger(UploadMetrics.class).info(<br \/>\n            &#034;\u6587\u4ef6\u4e0a\u4f20: \u6587\u4ef6\u540d&#061;{}, \u5927\u5c0f&#061;{}MB, \u7ed3\u679c&#061;{}&#034;,<br \/>\n            filename, size \/ (1024.0 * 1024.0), success ? &#034;\u6210\u529f&#034; : &#034;\u5931\u8d25&#034;<br \/>\n        );<br \/>\n    }<br \/>\n} <\/p>\n<h3 id=\"834dfcf3\">\u914d\u7f6e\u603b\u7ed3\u8868<\/h3>\n<table id=\"Wf52B\">\n<tbody>\n<tr>\n<td>\n<p id=\"ueeb5ccfc\">\u914d\u7f6e\u4f4d\u7f6e<\/p>\n<\/td>\n<td>\n<p id=\"u6da2d5bd\">\u914d\u7f6e\u9879<\/p>\n<\/td>\n<td>\n<p id=\"ucc0f46f2\">\u63a8\u8350\u503c<\/p>\n<\/td>\n<td>\n<p id=\"u31b66dec\">\u4f5c\u7528<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"udb63ca33\">Spring Boot<\/p>\n<\/td>\n<td>\n<p id=\"ua166b862\">server.undertow.max-http-post-size<\/p>\n<\/td>\n<td>\n<p id=\"u31352a21\">100MB<\/p>\n<\/td>\n<td>\n<p id=\"uc253b7fc\">\u5173\u952e\u914d\u7f6e&#xff0c;\u89e3\u51b3Undertow\u9650\u5236<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"ufd511e5a\">Spring Boot<\/p>\n<\/td>\n<td>\n<p id=\"u2a60bf98\">spring.servlet.multipart.max-file-size<\/p>\n<\/td>\n<td>\n<p id=\"uf442b297\">50MB<\/p>\n<\/td>\n<td>\n<p id=\"uf46c3d75\">\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u9650\u5236<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"u8c733b64\">Spring Boot<\/p>\n<\/td>\n<td>\n<p id=\"ud66551c2\">spring.servlet.multipart.max-request-size<\/p>\n<\/td>\n<td>\n<p id=\"ua8d76cfc\">100MB<\/p>\n<\/td>\n<td>\n<p id=\"u7110aeac\">\u6574\u4e2a\u8bf7\u6c42\u5927\u5c0f\u9650\u5236<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"uef92e124\">Nginx<\/p>\n<\/td>\n<td>\n<p id=\"u41c7ba13\">client_max_body_size<\/p>\n<\/td>\n<td>\n<p id=\"u894aa93f\">100-200MB<\/p>\n<\/td>\n<td>\n<p id=\"u148ca7b7\">Nginx\u4ee3\u7406\u5c42\u9650\u5236<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"u5d56e1b1\">\u524d\u7aefJS<\/p>\n<\/td>\n<td>\n<p id=\"u89a29600\">\u6587\u4ef6\u5927\u5c0f\u68c0\u67e5<\/p>\n<\/td>\n<td>\n<p id=\"u53036537\">20MB<\/p>\n<\/td>\n<td>\n<p id=\"u496a5cf2\">\u7528\u6237\u4f53\u9a8c\u4f18\u5316<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"07eadb56\">\u5feb\u901f\u4fee\u590d\u6b65\u9aa4<\/h3>\n<p id=\"ucd8b2ca4\">\u5982\u679c\u65f6\u95f4\u7d27\u8feb&#xff0c;\u6309\u4ee5\u4e0b\u6b65\u9aa4\u5feb\u901f\u4fee\u590d&#xff1a;<\/p>\n<li id=\"u2d23c5de\">\u7acb\u5373\u4fee\u6539application.properties&#xff1a;<\/li>\n<p>spring.servlet.multipart.max-file-size&#061;100MB<br \/>\nspring.servlet.multipart.max-request-size&#061;100MB<br \/>\nserver.undertow.max-http-post-size&#061;100MB <\/p>\n<li id=\"u22ac971a\">\u5982\u679c\u6709Nginx&#xff0c;\u4fee\u6539Nginx\u914d\u7f6e&#xff1a;<\/li>\n<p>client_max_body_size 100M; <\/p>\n<li id=\"u6ca27bbf\">\u91cd\u542f\u670d\u52a1&#xff1a;<\/li>\n<p># \u91cd\u542fSpring Boot\u5e94\u7528<br \/>\n.\/mvnw spring-boot:run<\/p>\n<p># \u6216<br \/>\njava -jar your-app.jar<\/p>\n<p># \u91cd\u542fNginx<br \/>\nsudo systemctl restart nginx <\/p>\n<li id=\"u3e869f62\">\u9a8c\u8bc1&#xff1a;\u4e0a\u4f20\u4e00\u4e2a\u7565\u5927\u4e8e20MB\u7684\u6587\u4ef6\u6d4b\u8bd5\u3002<\/li>\n<h3 id=\"d3c8e133\">\u5982\u679c\u95ee\u9898\u4ecd\u7136\u5b58\u5728<\/h3>\n<p id=\"u712fde04\">\u5982\u679c\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u914d\u7f6e\u540e\u95ee\u9898\u4f9d\u65e7&#xff0c;\u8bf7\u68c0\u67e5&#xff1a;<\/p>\n<li id=\"u1d306c9c\">\u914d\u7f6e\u662f\u5426\u751f\u6548&#xff1a;\u8bbf\u95ee \/config\/info\u63a5\u53e3\u67e5\u770b\u914d\u7f6e<\/li>\n<li id=\"u15720f26\">\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e&#xff1a;\u786e\u4fdd\u4fee\u6539\u7684\u662f\u8fd0\u884c\u65f6\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n<li id=\"u8dd1c14e\">\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6&#xff1a;\u68c0\u67e5\u662f\u5426\u6709 application-dev.properties\u7b49\u73af\u5883\u7279\u5b9a\u914d\u7f6e<\/li>\n<li id=\"u3b5148a3\">\u670d\u52a1\u5668\u91cd\u542f&#xff1a;\u786e\u8ba4\u5e94\u7528\u5df2\u5b8c\u5168\u91cd\u542f<\/li>\n<li id=\"uef14bcd4\">\u67e5\u770b\u5b8c\u6574\u65e5\u5fd7&#xff1a;\u68c0\u67e5Spring Boot\u542f\u52a8\u65e5\u5fd7\u4e2d\u5173\u4e8eMultipart\u7684\u914d\u7f6e\u4fe1\u606f<\/li>\n<p id=\"u5af1c3d4\">\n<p id=\"u980a664a\">\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 \u7684\u95ee\u9898\u3002\u9519\u8bef\u4fe1\u606f\u663e\u793a\u8bf7\u6c42\u5927\u5c0f\u8d85\u8fc7\u4e86\u914d\u7f6e\u7684\u6700\u5927\u503c&#xff08;20MB&#xff09;\u3002 \u914d\u7f6e\u63a8\u8350\u503c<br \/>\n\u6839\u636e\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f&#xff0c;\u5efa\u8bae\u7684\u914d\u7f6e&#xff1a; \u573a\u666f  max-file-size  max-request-size  \u8bf4\u660e  \u666e\u901a\u8868\u5355  10MB  20MB  \u666e\u901a\u7528\u6237\u4e0a\u4f20  \u56fe\u7247\u5206\u4eab  20MB  50MB  \u56fe\u7247\u3001\u5934\u50cf\u4e0a\u4f20  \u6587\u6863\u7cfb\u7edf  100MB  200MB  PDF\u3001\u6587\u6863\u4e0a\u4f20  \u89c6\u9891\u4e0a\u4f20  500MB  1GB  \u5c0f<\/p>\n","protected":false},"author":2,"featured_media":75765,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,114,101,98,100],"topic":[],"class_list":["post-75766","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-mysql","tag-spring","tag-spring-boot","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/75766.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 \u7684\u95ee\u9898\u3002\u9519\u8bef\u4fe1\u606f\u663e\u793a\u8bf7\u6c42\u5927\u5c0f\u8d85\u8fc7\u4e86\u914d\u7f6e\u7684\u6700\u5927\u503c&#xff08;20MB&#xff09;\u3002 \u914d\u7f6e\u63a8\u8350\u503c \u6839\u636e\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f&#xff0c;\u5efa\u8bae\u7684\u914d\u7f6e&#xff1a; \u573a\u666f max-file-size max-request-size \u8bf4\u660e \u666e\u901a\u8868\u5355 10MB 20MB \u666e\u901a\u7528\u6237\u4e0a\u4f20 \u56fe\u7247\u5206\u4eab 20MB 50MB \u56fe\u7247\u3001\u5934\u50cf\u4e0a\u4f20 \u6587\u6863\u7cfb\u7edf 100MB 200MB PDF\u3001\u6587\u6863\u4e0a\u4f20 \u89c6\u9891\u4e0a\u4f20 500MB 1GB \u5c0f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/75766.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-12T21:43:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260212214307-698e496b01fc1.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75766.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/75766.html\",\"name\":\"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-12T21:43:09+00:00\",\"dateModified\":\"2026-02-12T21:43:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/75766.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/75766.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75766.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/75766.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 \u7684\u95ee\u9898\u3002\u9519\u8bef\u4fe1\u606f\u663e\u793a\u8bf7\u6c42\u5927\u5c0f\u8d85\u8fc7\u4e86\u914d\u7f6e\u7684\u6700\u5927\u503c&#xff08;20MB&#xff09;\u3002 \u914d\u7f6e\u63a8\u8350\u503c \u6839\u636e\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f&#xff0c;\u5efa\u8bae\u7684\u914d\u7f6e&#xff1a; \u573a\u666f max-file-size max-request-size \u8bf4\u660e \u666e\u901a\u8868\u5355 10MB 20MB \u666e\u901a\u7528\u6237\u4e0a\u4f20 \u56fe\u7247\u5206\u4eab 20MB 50MB \u56fe\u7247\u3001\u5934\u50cf\u4e0a\u4f20 \u6587\u6863\u7cfb\u7edf 100MB 200MB PDF\u3001\u6587\u6863\u4e0a\u4f20 \u89c6\u9891\u4e0a\u4f20 500MB 1GB \u5c0f","og_url":"https:\/\/www.wsisp.com\/helps\/75766.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-12T21:43:09+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260212214307-698e496b01fc1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/75766.html","url":"https:\/\/www.wsisp.com\/helps\/75766.html","name":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-12T21:43:09+00:00","dateModified":"2026-02-12T21:43:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/75766.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/75766.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/75766.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u8d85\u8fc7\u670d\u52a1\u5668\u9650\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=75766"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75766\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/75765"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=75766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=75766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=75766"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=75766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}