You need to sign in to do that
Don't have an account?
Paridhi Bindal 9
Display Attachment (profile picture) as display picture in LWC img
Hello everyone,
I am trying to display profile picture when a user logs-in in the community. The image file is on Contact object attachment record. How can I add it in img src on LWC?
Thanks.
I am trying to display profile picture when a user logs-in in the community. The image file is on Contact object attachment record. How can I add it in img src on LWC?
Thanks.
1. Encode attachment to BAse64 string by System.EncodingUtil.base64Encode(attachment.body);
2. Add chacheable method that returns the string
3. Using wire get the base64 string and display the image by appending 'data:image/jpeg;base64'.
All the best everyone.
All Answers
1. Encode attachment to BAse64 string by System.EncodingUtil.base64Encode(attachment.body);
2. Add chacheable method that returns the string
3. Using wire get the base64 string and display the image by appending 'data:image/jpeg;base64'.
All the best everyone.