Can i upload multiple file with React and Slingshot in Meteor


#1

i can’t upload multiple file with slingshot ( i have error 400 from server )

this is code from client

upload() {
let images = [];
let files = document.getElementById(‘images’).files;
console.log(files);
const n = files.length;
let uploader = new Slingshot.Upload(‘ProductImages’);
for (let i = 0; i < n; i++) {
uploader.send(document.getElementById(‘images’).files[i], function(error, downloadUrl) {
if (error) {
alert(error);
}
else {
images[i] = downloadUrl;
}
this.setState({ImgUrl: downloadUrl});
console.log(downloadUrl);
}.bind(this));
}

}


#2

Have you confirmed that this only happens with multiple files? If not it may be an error in your slingshot configuration.