(BUG?) (SOLVED) UploadButton problem in Multi-State Box

I found out that if you have an UploadButton inside a Multi-State Box, change the Box’s state to another state and then change it back to the original state, the UploadButton will always return the same error when trying to upload a file:
Error: -1; No File To Upload

Its not a bug - Multi-State Box States are cleared once changed, to allow better performance. Which means the files pending upload are cleared.

This comes directly from Wix. Check out the comment here .

I’m not sure how that relates to my problem. I think I wasn’t clear enough. The error occurs when I try to upload a new file. The UploadButton is empty and when I choose a file it returns an error, the state doesn’t change while uploading, it changes before I click the UploadButton.

Never mind I figured it out. I need to reset the UploadButton when changing state:

//...
$w("#statebox1").changeState("inputs");
$w("#uploadButton1").reset();

Thanks.

@pptgames It is bug. i don’t think it’s supposed to behave like that. But if you could find a solution that’s great.

@jonatandor35 I already found a solution:
You need to reset the UploadButton when changing state:

//...
$w("#statebox1").changeState("inputs");
$w("#uploadButton1").reset();

Is it possible to send the data from uploadbutton to some variable and, after that, use setfieldvalue?