function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Afghan Khair.Afghan Khair. 

I am unable to add an image in lightning component

NagendraNagendra (Salesforce Developers) 
Hi Afghan,

May I request you to be more specific on your requirement so that we can understand better of the requirement and can help you accordingly.

Assuming you want to display image from a static resource in the Lightning component.

You can create a very simple lightning component to display image from a static resource or attachment/file or a Static resource

Static Resource:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
	<img src="{!$Resource.StaticResourceName}"/>
</aura:component>
If you are using attachment or file. View attachment and use that URL like this:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
	<img src="https://ankushdureja--dev2--c.cs68.content.force.com/servlet/servlet.FileDownload?file=00P1D000000Iiyd"/>
</aura:component>
Please let us know if you are looking for anything else other than this.

Hope this helps.

Kindly mark this as solved if the information is helpful.

Thanks,
Nagendra

 
SamHowleSamHowle
Man that guy really left you hanging. Anyways, this helped me out. Thanks!