Browse Source

回传真实文件名

NorthLan 6 years ago
parent
commit
94b580811e

+ 2 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/UploadController.kt

@@ -42,6 +42,7 @@ class UploadController : BaseController() {
                 CheckStatus.FILE_EXISTS,
                 CheckStatus.NO_FILE_FULL_CHUNK -> {
                     // 文件存在
+                    fileMetadata.filename = ret.file?.name
                     ret.info = fileMetadata
                 }
                 CheckStatus.NO_FILE_FRAG_CHUNK -> {
@@ -70,6 +71,7 @@ class UploadController : BaseController() {
             when (uploadResult.status) {
             // 单文件完成,插入数据库
                 UploadStatus.UPLOADED -> {
+                    fileMetadata.filename = uploadResult.file?.name
                     uploadResult.info = fileMetadata
                 }
             }