# Cannot upload file

**URL:** <https://community.weweb.io/t/cannot-upload-file/15132>\
**Category:** Ask us anything\
**Created:** [December 26, 2024, 5:32am UTC](https://community.weweb.io/t/cannot-upload-file/15132 "2024-12-26T05:32:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwkhor](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@jwkhor](https://community.weweb.io/u/jwkhor)\
**Post date:** [December 26, 2024, 5:32am UTC](https://community.weweb.io/t/cannot-upload-file/15132/1 "2024-12-26T05:32:04Z")

</div>

Cannot upload same file again after reset Input File Drop value

![msedge_gmqj67hsei](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/5/56ca5905dd4fc365782c30552bf8df63d3797861.gif)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8bcf2799a366bf0a1a013e69c3db717398d1a4bd.png)  
button workflow - reset variable

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/676c53d92407a8601d00f69105e24246d4f91f02.png)  
There is no workflow for Input File Drop

---

<div class="post-metadata">

**Author:** ![jptrinh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jptrinh/32/1493_2.png) [@jptrinh](https://community.weweb.io/u/jptrinh)\
**Post date:** [December 27, 2024, 10:14pm UTC](https://community.weweb.io/t/cannot-upload-file/15132/2 "2024-12-27T22:14:17Z")

</div>

Hey @jwkhor

The default `Input File Drop - value` variable is a bit misleading.  
What’s happening is that its value does not reflect the value of the actual input (the HTML element).  
So when you are resetting the `Input File Drop - value`, you are not resetting the value of the HTML input element. And when you are trying to add the same file again, it doesn’t trigger the `onChange` event because, it’s not actually changing.

What I’ve done to solve this is resettting the value of the HTML input at the end of the onChange workflow. This was done using some Custom JS. The code looks like this (although I’d recommend doing that in a component to have a safer targetting)

```auto
// Select the input
const fileInput = wwLib.getFrontDocument().querySelector("yourInput");
// Reset its value
fileInput.value = null;

```

Let me know if that was clear enough 🙂
