• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

152
Views
No se puede cargar el mismo archivo varias veces usando Angular

Estoy enfrentando un problema al cargar el mismo archivo varias veces usando angular. Estoy explicando mi código a continuación.

 <label [for]="'file' + i" style="width: 100%;cursor: pointer;text-align: center;"> <div id="drop_zone" (drop)="dropPayLoad($event, i, fileType.CONFIG_FILE)" (dragover)="allowPayloadDrop($event, i, fileType.CONFIG_FILE)"> <span class="pat-span">{{fileLableArr[i]['config_name']}}</span> <input type="file" hidden [id]="'file' + i" (change)="handleUploads($event.target.files, fileType.CONFIG_FILE, i)"> <span *ngIf="fileLableArr[i]['isConfig']" style="position: relative;top: 6px;left: 5px;font-size: 31px;" (click)="$event.preventDefault();deleteUploadedFile($event, fileType.CONFIG_FILE, i)">&times;</span> </div> </label>

Aquí usando input type = file cuando estoy cargando el mismo archivo una y otra vez, la primera vez se carga correctamente, pero la próxima vez ahora permite cargar e incluso el evento (chnage) no se activa. Aquí también necesito permitir el mismo archivo varias veces y el evento de cambio debería activarse. Hice la búsqueda en Google y agregué una solución como this.value=null pero tampoco funcionó. Avíseme si alguien puede ayudarme a resolver este problema.

about 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error