SpringMVC + ajaxfileupload的多文件上传
最近做一个springmvc ajax多文件上传,倒腾了下,查阅了部分资料搞定了!现在分享:
1.Spring mvc
a.xml配置:
function ajaxFileUploadImg(id){ //获取file的全部id var uplist = $("input[name^=uploads]");var arrId = [];for (var i=0; i< uplist.length; i++){ if(uplist[i].value){ arrId[i] = uplist[i].id;} }$.ajaxFileUpload({url:'xxxxx',secureuri:false,fileElementId: arrId, //这里不在是以前的id了,要写成数组的形式哦!dataType: 'json',data: { //需要传输的数据 },success: function (data){},error: function(data){}});}亲们,一个spingmvc +ajax多文件上传有搞定了,功能很简单,有问题联系本人