Re: [w3c/FileAPI] Add a FileList.drop(index) method (#25)

Note that this can be done using the [FormData](https://xhr.spec.whatwg.org/#interface-formdata) interface. Given a form such as:

```html
<form id=f>
  <input name=fs type=files multiple>
</form>
```

* Create a FormData populated with the form:
   `fd = new FormData(document.getElementById('f'))`
* Get an array of the files:
   `files = fd.getAll('fs')`
* Remove from the FormData:
  `fs.delete('fs')`
* Filter the files:
   `files = files.filter(file => ...)`
* Assign back to the FormData:
   `files.forEach(file => fd.append('fs', file))`
* Submit the FormData via [fetch](https://fetch.spec.whatwg.org/) or [XHR](https://xhr.spec.whatwg.org)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/25#issuecomment-283756829

Received on Thursday, 2 March 2017 19:39:48 UTC