Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!