Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda