有没有办法将文件附加到已经存在的文件列表中?
function file_select_handler(e){
file_drag_hover(e);
var new_files = e.target.files || e.dataTransfer.files;
//something like:
files.append(new_files);
for (var i = 0, f; f = files[i]; i++) {
parse_file(f);
}
}
编辑//我现在已经尝试过了:
function file_select_handler(e){
file_drag_hover(e);
var new_files = e.target.files || e.dataTransfer.files;
files_collect.push(new_files);
for (a in files_collect) {
for (b in files_collect[a]) {
parse_file(files_collect[a][b]);
}
}
}
//编辑不回答:::://
But the above seems to put a pointer into the array, so when more files are chosen, they replace the others stored in the array. 疯狂的?有什么帮助吗?