Upload component upload document multiple times

Hi, I have an upload component with a limit of 1 file upload. However once i upload this file i cannot upload a new one to override, the button no longer responds (i see the attribute max-files-reached on it). Is it possible to somehow upload a new document and discard previous one automatically?

Automatically not, but you can call clearFilelist();

but i guess it would require interaction from the user like a new button which calls it

or cancel it in the files list

There are event listeners like onSuccess or onFinish that can be used