# Should removeFile remove the successfully uploaded file from the DOM?

**URL:** <https://community.transloadit.com/t/should-removefile-remove-the-successfully-uploaded-file-from-the-dom/15811>\
**Category:** Uppy\
**Created:** [August 22, 2021, 2:07am UTC](https://community.transloadit.com/t/should-removefile-remove-the-successfully-uploaded-file-from-the-dom/15811 "2021-08-22T02:07:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ophelas](https://avatars.discourse-cdn.com/v4/letter/o/ad7895/32.png) [@ophelas](https://community.transloadit.com/u/ophelas)\
**Post date:** [August 22, 2021, 2:07am UTC](https://community.transloadit.com/t/should-removefile-remove-the-successfully-uploaded-file-from-the-dom/15811/1 "2021-08-22T02:07:58Z")

</div>

The docs suggest that I set `showRemoveButtonAfterComplete: true` and then use `removeFile(file.id)` to remove the file, but I am not able to do what I think seems intuitive (which is remove the file from the `uppyResult` input in the DOM) with the code that is provided.

```auto
.on('file-removed', (file, reason) => {
 if (reason === 'removed-by-user') {
  uppy.removeFile(file.id)
 }
})

```

With this code, nothing happens when I click the X next to the uploaded image. Am I doing this wrong?
