这是uploadcare问题。
如何使用 uploadcare js api 上传多个文件?
我有这段代码,但没有运气
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]);
}
最佳答案
uploadcare.fileFrom
之间的区别和uploadcare.filesFrom
第一个采用一个初始对象并返回一个 uploadcare 文件,第二个采用对象数组并返回 uploadcare 文件数组。所以你不需要迭代files
将其发送到 filesFrom
.
var uploads = uploadcare.filesFrom('object', document.getElementById('files').files);
console.log(uploads);
关于javascript - 如何在uploadcare中上传多个文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22852868/