How to clean file input?


Topic: How to clean file input?

miguel Angel (miqi) asked 6 years ago

Hello, someone could guide me, Does anyone know how to clean the input file? I tried restarting the form but it does not work I have not had any luck searching the internet.

Damian Gemza staff answered 6 years ago

Dear Miguel,
What do you mean by clearing the file input field? Do you want to remove files which user has added into file input field? Or something else?

If you want to remove files from the array, you could create a method which assigns empty array into files variable.

So the code would like similar as mine:

clearFiles() {

 this.files= [];

}

Best Regards,

Damian


miguel Angel (miqi) commented 6 years ago

Dear Damian , Thanks for your contribution, they have served me a lot, not in the same way that you indicate it but very similar:   <pre>this.file = <UploadFile> {};</pre>

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No