Dar*_*ava 8 javascript html5 file
我正在尝试使用新的File API对输入文件进行排序.它返回的列表似乎是不可变的:
var x = "";
var files = e.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
files.sort();
> Uncaught TypeError: Object #<FileList> has no method 'sort'
Run Code Online (Sandbox Code Playgroud)
如果我想一次读入多个文件,但我希望它们按顺序到达.(A.csv之前处理B.csv等).这可以实现吗?
Jan*_*oom 12
[].slice.call(files)使它成为一个真正的数组,然后你可以使用.sort它.