无法将多个图像的uri附加到FormData对象中

时间:2016-09-09 05:21:42

标签: javascript form-data

我想使用表单数据上传图片。当我上传一张图片时,图片已成功上传,但当我附加多张图片时,它不会附加。并且没有数据传递到服务器。

var data = new FormData();

data.append('imagea',arr[0].uri);//if I append only one image it will get uploaded
data.append('imageb',arr[1].uri);//When I try to append another image it wont append

var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://192.168.169.188/classifiedad/AdvertisementSvc.svc/NewAdvertisement', true);
xhr.onload = function () {
    console.log(this.responseText);
};
xhr.send(data);

日志enter image description here

0 个答案:

没有答案
相关问题