Cannot upload file

Cannot upload same file again after reset Input File Drop value

msedge_gmqj67hsei


button workflow - reset variable


There is no workflow for Input File Drop

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)

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

Let me know if that was clear enough :slight_smile:

1 Like