OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Can't use forEach with Filelist

  • Thread starter Thread starter alex
  • Start date Start date


I'm trying to loop through a Filelist:

console.log('field:', field.photo.files)
field.photo.files.forEach(file => {
   // looping code

As you can see field.photo.files has a Filelist:

enter image description here

How to properly loop through field.photo.files?

<p>I'm trying to loop through a <code>Filelist</code>:</p>

<pre><code>console.log('field:', field.photo.files)
field.photo.files.forEach(file => {
// looping code

<p>As you can see <code>field.photo.files</code> has a <code>Filelist</code>:</p>

<p><a href="https://i.sstatic.net/ci9Er.png" rel="noreferrer"><img src="https://i.sstatic.net/ci9Er.png" alt="enter image description here"></a></p>

<p>How to properly loop through <code>field.photo.files</code>?</p>

Latest posts