+ Start a Discussion
Angel ZAngel Z 

Aura Component - display image from file

Hi all,

I need to display an image from a file to an aura component.

Can someone give me a piece of advice for the img source?

I tried 
<img src="{!'/sfc/servlet.shepherd/version/download/0681w000000iOxfAAE'}" />

However, it does not work.

Deepali KulshresthaDeepali Kulshrestha
Hi Angel,

You can try adding your image in the static resource and refer to the static resource by using the following method:

for stylesheets: <ltng:require styles="{!$Resource.<your_resource_name> +

for image: <img src="{!$Resource.<your_resource_name> + '/assets/icons/action/user_60.png'}"></img>

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha