多文件上传没办法为每个文件提供不同的额外参数值吗
layui吧
全部回复
仅看楼主
level 1
2018年10月31日 02点10分 1
level 1
楼主解决了吗
2020年08月04日 10点08分 2
level 1
我也想问
2020年08月07日 08点08分 3
level 1
同上,多文件列表上传,我想给图片加一个自定义字段
2020年08月17日 04点08分 4
level 1
类似这种,统一上传,每个动态传参
2020年08月17日 04点08分 6
level 1
,uploadListIns = upload.render({
elem: '#testList'
,url: "" //改成您自己的上传接口
,accept: 'file'
,multiple: true
,auto: false
,bindAction: '#testListAction'
,data:{
params:'',
type:'image',
modelid:"<?=$modelid?>",
p_id:"<?=$art_id?>"
}
,before: function (obj) {
var json = [];
layui.each($('input[name="img_title"]'), function (index, item) {
json.push({"fileName":$(item).parents('td').siblings('.fileName').html(),"img_title":$(item).val()});
});
this.data.params = JSON.stringify(json);
}
多文件before 只会触发一次,所以一次性把所有的值传一个json 到后台,然后后台再调用你要用的
2020年08月18日 09点08分 7
1