Discuz! X3 手机版批量上传图片的方法(转)
分类 网站技术/村民张先生 发布于 2020-01-13 03:24
打开 touch/forum/post.htm 模板,查找:
<input type="file" name="Filedata" id="filedata"
替换为:
<input type="file" name="Filedata" id="filedata" multiple="multiple"
查找:
$.buildfileupload({ uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2', files:this.files, uploadformdata:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G[config][security][authkey]), 8).$_G[uid])}-->"}, uploadinputname:'Filedata', maxfilesize:"$swfconfig[max]", success:uploadsuccess, error:function() { popup.open('{lang uploadpicfailed}', 'alert'); } });
替换为:
for (var i=0;i<this.files.length;i++ ) { var file_data = []; file_data.push(this.files[i]); $.buildfileupload({ uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2', files:file_data, uploadformdata:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G[config][security][authkey]), 8).$_G[uid])}-->"}, uploadinputname:'Filedata', maxfilesize:"2000", success:uploadsuccess, error:function() { popup.open('上传失败,请稍后再试!', 'alert'); } }); }
上传覆盖,更新缓存。
来源:https://blog.csdn.net/u011483786/article/details/83994658
欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截