From 037918e8e514c5b17eeb9bc9feaaf5f61b5b743a Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 27 Oct 2025 09:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Upload=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=BB=8E=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/file/web/FileUploadController.java | 11 ++++++++--- .../resources/views/htmltags/form/fileupload.html | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/modules/file/web/FileUploadController.java b/modules/core/src/main/java/com/jeesite/modules/file/web/FileUploadController.java index 63fe7c82..610c1a1b 100644 --- a/modules/core/src/main/java/com/jeesite/modules/file/web/FileUploadController.java +++ b/modules/core/src/main/java/com/jeesite/modules/file/web/FileUploadController.java @@ -45,14 +45,19 @@ public class FileUploadController extends BaseController { @ResponseBody public Map params() { Map model = MapUtils.newHashMap(); + model.put("maxFileSize", Global.getConfigToLong("file.maxFileSize", "500*1024*1024")); + model.put("imageAllowSuffixes", Global.getConfig("file.imageAllowSuffixes", FileUploadParams.DEFAULT_IMAGE_ALLOW_SUFFIXES)); model.put("mediaAllowSuffixes", Global.getConfig("file.mediaAllowSuffixes", FileUploadParams.DEFAULT_MEDIA_ALLOW_SUFFIXES)); model.put("fileAllowSuffixes", Global.getConfig("file.fileAllowSuffixes", FileUploadParams.DEFAULT_FILE_ALLOW_SUFFIXES)); - model.put("chunked", Global.getConfig("file.chunked", "true")); - model.put("chunkSize", Global.getConfigToInteger("file.chunkSize", "10*1024*1024")); - model.put("threads", Global.getConfigToInteger("file.threads", "3")); + model.put("imageMaxWidth", Global.getConfigToInteger("file.imageMaxWidth", "1024")); model.put("imageMaxHeight", Global.getConfigToInteger("file.imageMaxHeight", "768")); + + model.put("checkmd5", Global.getConfigToBoolean("file.checkmd5", "true")); + model.put("chunked", Global.getConfigToBoolean("file.chunked", "true")); + model.put("chunkSize", Global.getConfigToInteger("file.chunkSize", "10*1024*1024")); + model.put("threads", Global.getConfigToInteger("file.threads", "3")); return model; } diff --git a/modules/core/src/main/resources/views/htmltags/form/fileupload.html b/modules/core/src/main/resources/views/htmltags/form/fileupload.html index f884da7c..f0c813ca 100644 --- a/modules/core/src/main/resources/views/htmltags/form/fileupload.html +++ b/modules/core/src/main/resources/views/htmltags/form/fileupload.html @@ -161,9 +161,9 @@ $(function() { fileNameInputId: '${p.fileNameInputId}', uploadType: '${p.uploadType}', maxFileSize: "#{isNotBlank(p.maxFileSize)?p.maxFileSize:@Global.getConfig('file.maxFileSize', '500*1024*1024')}", - imageAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.imageAllowSuffixes", ".gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,.webp,")}', - mediaAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.mediaAllowSuffixes", ".flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,")}', - fileAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.fileAllowSuffixes", ".doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.ofd,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,")}', + imageAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.imageAllowSuffixes", @com.jeesite.modules.file.entity.FileUploadParams.DEFAULT_IMAGE_ALLOW_SUFFIXES)}', + mediaAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.mediaAllowSuffixes", @com.jeesite.modules.file.entity.FileUploadParams.DEFAULT_MEDIA_ALLOW_SUFFIXES)}', + fileAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.fileAllowSuffixes", @com.jeesite.modules.file.entity.FileUploadParams.DEFAULT_FILE_ALLOW_SUFFIXES)}', chunked: "#{__info_type=='0'?false:@Global.getConfig('file.chunked', 'true')}", chunkSize: "#{@Global.getConfigToInteger('file.chunkSize', '10*1024*1024')}", threads: "#{@Global.getConfigToInteger('file.threads', '3')}",