[directory-upload] Easier way to get files without complicated asynchronous traversal code (#26)

It seems like the 90% use case for this is going to be to just get all the files from a directory (as one can't do much with a directory anyway), so why don't we provide a nice method to just get a flattened list of files? 

```JS
directory.getFiles({recursive: true}) //or {deep: true}, so to avoid complicated traversal 
  .then(filterImagesUnder2MB)
  .then(images => Promise.all(files.map(uploadImage))
  .then(showDone)
  .catch(err => console.error("Uploading failed!", err))
```

As files contain their own stats info, a developer can get at the path directly from the file to see where they are in the directory hierarchy. 

WDYT? 

---
Reply to this email directly or view it on GitHub:
https://github.com/WICG/directory-upload/issues/26

Received on Wednesday, 2 December 2015 03:32:07 UTC