This is uploadcare question.
How to upload multiple files using uploadcare js api ?
I have this code but no luck
for (var x = 0; x < document.getElementById('files').files.length; x++) {
console.log(x);
console.log(document.getElementById('files').files[x]);
uploadcare.filesFrom('object', document.getElementById('files').files[x]);
}
The difference between uploadcare.fileFrom
and uploadcare.filesFrom
is the first takes one initial object and returns exactly one uploadcare file, the second takes array of objects and returns array of uploadcare files. So you do not need to iterate files
to transmit it in filesFrom
.
var uploads = uploadcare.filesFrom('object', document.getElementById('files').files);
console.log(uploads);
Please, look at live example http://jsbin.com/zayuz/1/watch?html,js,output