Issue with upload widget in reactive web.
Application Type
Reactive

Hi community members,
Need a little help here, I'm using upload widget in reactive web. It is working and everything is set but there is one issue with it, when I upload a file and reset the variables of upload widget in the client action, the widget uploads that file but when I try to upload the same file without refreshing the page or without selecting any other file once, it restricts me to upload that same file, that is I couldn't upload same file without refreshing the page or I have to select any other file first.

If anyone have any suggestions why upload widget is showing this kind of behavior please help me out here. 

mvp_badge
MVP
Solution

Hi Shailesh,

When you reset your local variable which contains file binary or name it doesn't reset actual file input. So even if it shows no name in the upload widget there is file selected actually. Use developer tool to inspect the upload widget in chrome and see there is an file input which is set to display none. if you uncheck display none style you will still see the selected file name.

To solve this you can run below js in the screen action where you are resetting your variables

document.querySelector("#" + $parameters.FileInputId + " > input[type=file]").value = null;

Hi,

What is the error you are facing while uploading same file again ? Coz I tried and didn't get error.

Regards,

Komal

mvp_badge
MVP
Solution

Hi Shailesh,

When you reset your local variable which contains file binary or name it doesn't reset actual file input. So even if it shows no name in the upload widget there is file selected actually. Use developer tool to inspect the upload widget in chrome and see there is an file input which is set to display none. if you uncheck display none style you will still see the selected file name.

To solve this you can run below js in the screen action where you are resetting your variables

document.querySelector("#" + $parameters.FileInputId + " > input[type=file]").value = null;

mvp_badge
MVP

Hi Shailesh,

In addition to the previous comments, Just want to include one of the old post addressing the same case.

Refer this post:  https://www.outsystems.com/forums/discussion/59369/is-it-posible-to-add-option-to-delete-cache-on-upload-widget-on-mobille/#Post226516


Hope this helps you!


Kind regards,

Benjith Sam

Hi Nikhil,
Thanks for the answer the JS code resolved my issue.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.