Refresh image after image file upload?

I have a collection for the members of my website (name, email, phone, …).

I have added the ability for users to view (and update) their profile information.

On the page to modify members information, they can change their information including their image/avatar using the “upload button”. When the upload is “complete”, I would like to refresh the image that is currently displayed.

Once the upload is complete, how do you refresh the image so the user can see the change?

Thanks!

2 Likes

If you connect the image to the dataset you just re query the dataset after and it will be updated.

Thanks Andreas. My image is connected to the data set. Would you mind telling me how to fire off a “re-query” after the upload is complete? I am sure it is easy but am new to WIX code and events. Thanks!

EDIT: I am going to use the code and example here. I like the “two button” approach. Hopefully this helps others as well. See: Velo Tutorial: Using the Upload Button with Code | Help Center | Wix.com

$w(‘#dataset1’).refresh();

@Uri Tagger - thanks for this!!

Question #1: where in the code presented in the https://support.wix.com/en/article/how-to-use-the-upload-button-with-code that you add “$w(’ #dataset1 ').refresh();”?
Question #2: What code should you write to save the uploaded image and where should I add the code?

Thanks,

Louise

Where in the code the $w(’ #dataset1 ').refresh(); should be added?
It is not working for me…

onAfterSave …

But it really just depends on your existing code. If you post a new question with a copy of your code (or a screenshot of your code) the community will be able to assist you a bit better rather than guessing.