From d8d3919cad68955f451d22edbc1ed6307c0e7258 Mon Sep 17 00:00:00 2001
From: zoewho <341936031@qq.com>
Date: Fri, 1 Dec 2023 14:48:40 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=89=88=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E5=92=8C=E9=99=84=E4=BB=B6=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E5=A4=9A=E9=80=89=E4=BB=A5=E5=8F=8A=E5=A4=9A=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=B8=8A=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
upload/template/default/touch/forum/post.htm | 65 +++++++++++++-------
1 file changed, 43 insertions(+), 22 deletions(-)
diff --git a/upload/template/default/touch/forum/post.htm b/upload/template/default/touch/forum/post.htm
index 6104906cc..d50377f54 100644
--- a/upload/template/default/touch/forum/post.htm
+++ b/upload/template/default/touch/forum/post.htm
@@ -117,7 +117,7 @@
@@ -320,18 +320,21 @@
}
};
if(typeof FileReader != 'undefined' && this.files[0]) {//note 支持html5上传新特性
-
- $.buildfileupload({
- uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
- files:this.files,
- uploadformdata:{uid:"$_G['uid']", hash:""},
- uploadinputname:'Filedata',
- maxfilesize:"$swfconfig['max']",
- success:uploadsuccess,
- error:function() {
- popup.open('{lang uploadpicfailed}', 'alert');
- }
- });
+ for (const file of this.files) {
+ var tmpfiles = [];
+ tmpfiles[0] = file;
+ $.buildfileupload({
+ uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
+ files:tmpfiles,
+ uploadformdata:{uid:"$_G['uid']", hash:""},
+ uploadinputname:'Filedata',
+ maxfilesize:"$swfconfig['max']",
+ success:uploadsuccess,
+ error:function() {
+ popup.open('{lang uploadpicfailed}', 'alert');
+ }
+ });
+ }
} else {
$.ajaxfileupload({
url:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
@@ -403,16 +406,34 @@
popup.open(STATUSMSG[dataarr[2]] + sizelimit, 'alert');
}
};
- $.ajaxfileupload({
- url:'misc.php?mod=swfupload&operation=upload&fid={$_G['fid']}&inajax=yes&infloat=yes&simple=2',
- data:{uid:"$_G['uid']", hash:""},
- dataType:'text',
- fileElementId:'attfiledata',
- success:uploadsuccess,
- error: function() {
- popup.open('{lang uploadpicfailed}', 'alert');
+ if(typeof FileReader != 'undefined' && this.files[0]) {//note 支持html5上传新特性
+ for (const file of this.files) {
+ var tmpfiles = [];
+ tmpfiles[0] = file;
+ $.buildfileupload({
+ uploadurl:'misc.php?mod=swfupload&operation=upload&fid={$_G['fid']}&inajax=yes&infloat=yes&simple=2',
+ files:tmpfiles,
+ uploadformdata:{uid:"$_G['uid']", hash:""},
+ uploadinputname:'Filedata',
+ maxfilesize:"$swfconfig['max']",
+ success:uploadsuccess,
+ error:function() {
+ popup.open('{lang uploadpicfailed}', 'alert');
+ }
+ });
}
- });
+ } else {
+ $.ajaxfileupload({
+ url:'misc.php?mod=swfupload&operation=upload&fid={$_G['fid']}&inajax=yes&infloat=yes&simple=2',
+ data:{uid:"$_G['uid']", hash:""},
+ dataType:'text',
+ fileElementId:'attfiledata',
+ success:uploadsuccess,
+ error: function() {
+ popup.open('{lang uploadpicfailed}', 'alert');
+ }
+ });
+ }
});
$('#postsubmit').on('click', function() {
var obj = $(this);
--
Gitee