From bb25a5db6119c4e7a1650216c1070e64632d146f Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Thu, 16 Oct 2025 15:40:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++++- .../xim/web/controllers/fileupload/FileUpload.java | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a32f0fc..bc9213e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# regulatory-management-system +# 产险厦门分公司规章制度管理工具 + + + +# 概述 产险厦门分公司规章制度管理工具。 \ No newline at end of file diff --git a/code/backend/RegulatoryManagementBackend/src/main/java/com/cpic/xim/web/controllers/fileupload/FileUpload.java b/code/backend/RegulatoryManagementBackend/src/main/java/com/cpic/xim/web/controllers/fileupload/FileUpload.java index ff0b413..460bd5a 100644 --- a/code/backend/RegulatoryManagementBackend/src/main/java/com/cpic/xim/web/controllers/fileupload/FileUpload.java +++ b/code/backend/RegulatoryManagementBackend/src/main/java/com/cpic/xim/web/controllers/fileupload/FileUpload.java @@ -21,8 +21,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.bind.annotation.RequestMethod; - // @SuppressWarnings( "unused" ) @Controller @@ -99,6 +97,17 @@ public class FileUpload return result; } + /** + * 接收上传文件,并保存到临时目录: + * 1、临时目录下再用sessionID作为子目录保存文件。 + * 2、保存时不更改文件名,会覆盖同名文件。 + * 3、MultipartFile参数形参名称必须和请求form中file标签的name属性一致,否则值为null。 + * 4、返回值为接收结果和文件保存绝对路径。 + * @param fileName + * @param file + * @param request + * @return + */ @RequestMapping( path = "/file-upload.do" ) @ResponseBody public FileUploadResult saveUploadFile(