Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
Firefox override the array value while storing the FileList object from an Angular project

I am trying to upload a file from the input field and want to store it in an array.

Upload : <input type="file" name="upload" #uploadFile>

<button (click)="storeFile(uploadFile)">Store file</button>

Now whenever user want to click on the store file, I am calling this function

listOfFile: Array<FileList> = [];

  storeFile(inputField: HTMLInputElement) {
    this.listOfFile.push(inputField?.files);
    console.log(this.listOfFile)

  }

The above code is working fine in chrome. However, if you look in the console from Firefox you will see that the array value is overridden. I could not figure out why Firefox is not working.

I have also created a sample app on stackBlitz. Please Have a look at that from your firefox. To see the problem, please upload a file and click the store button and inspect the console. Now try to upload another file and inspect it from Firefox. You will see then, the first value is overwritten.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda