I am trying to sort input files using the new File API. The list that it returns seems to be immutable:
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'
If I want to read in multiple files at once, but I want them to arrive in order. (A.csv
is processed before B.csv
, etc). Is this achievable?
[].slice.call(files)
to make it into a real array, then you can use .sort
on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With