FileList behaves incorrectly in a couple different ways

Issue #7475645 • Assigned to Ali A.


Michael W.
May 6, 2016
This issue is public.
Found in
  • Microsoft Edge
Standard affected
File API

Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Discovered when iterating through the properties of a FileList as though it were an array.

I’ve attached a rudimentary test file to demonstrate these behaviors, but I’ll describe them here:

First, FileList.prototype.hasOwnProperty always returns, making iteration difficult:

for (const index in myFileList) {
  if (myFileList.hasOwnProperty(index)) {
    // Nothing in here executes because FileList.prototype.hasOwnProperty
    // always returns false

Second, FileList.prototype.item is supposed to return the File item at a given index. It will also return a file if given a string:

myFileList.item(0) // => [object File]
myFileList.item(1) // => no item, this imaginary input has just one file
myFileList.item("any string") // => [object File]


1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Ibrahim O.”

    Changed Assigned To to “Travis L.”

    Changed Assigned To to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Shawn P.”

    Changed Assigned To from “Shawn P.” to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Ali A.”

You need to sign in to your Microsoft account to add a comment.

Sign in