Add image to members profiles

There is a very helpful tutorial on how to create member profile pages using WixCode here:

I want to add an image to the profile for each member. I had it working the other day but it is now broken. What is the easiest way to tweak the example above to add image support?

It would be cool to add that in to the sample code as I am sure many folks would benefit.

Any help is appreciated - Thanks!

Hey dmz,

Here’s one way:

  • add an $w.UploadButton to your page

  • connect the upload button to your user profile dataset

  • connect the File property of the button to the image field

  • add a button to “submit” the upload

  • connect the submit button to the profile dataset

  • the button Link connects to the Submit dataset action
    Run in Preview, click the upload button and select a file. Then, click the submit button. As you can see, the dataset does the heavy lifting and the image is uploaded to your collection.

I hope this was clear enough. It’s actually not all that difficult. Look at $w.UploadButton for more information.

Yisrael

Ysreal - many, many thanks! Again. :slight_smile: Second time you have been a huge help. :slight_smile:

One other question on this - I also show an image on the profile page that show the user’s profile including their image.

My ideal user experience would be for the image to be updated to the uploaded file. Is there an easy way to do this? Would I just point the image URL to the image display on the page using the onChange() trigger on the upload button?

I really appreciate your help again - thanks!

PS: Are you from Pittsburgh? I am originally from PA (my family is from Pittsburgh) but have lived all over the world (now in the uk). I love Pittsburgh - great city! May retire there… :slight_smile:

Hey, I’m glad I could help.

As far as how to update the image to the new uploaded file, I think you already learned how. Take a look here . The thing is that the onChange function just indicates that the selection of a file to be uploaded has been changed. You want to force an update (refresh) after the dataset is done with the heavy lifting.

I don’t live there now, but I grew up in Monroeville (east suburb of Pittsburgh). My family still lives there. The greatest place with the greatest people.

All the best