I have to display an image in a lightning component. So in Salesforce classic I put this image in an attachment related to an object, but in lightning experience there is no attachment, or I didn't find them. There is only the possibility to add a file.
My question is how can I retrieve this file in my component ? For an attachment I retrieve the attachment like that :
List<Attachment> img = [select Id, Name, ContentType, parentId from Attachment
where parentId in :listeId and ContentType in ('image/png', 'image/jpeg', 'image/gif')];
and in my component I put that :
<img src="{!'/servlet/servlet.FileDownload?file=' + a.image.Id}" alt=""/>
but it doens't retrieve me the url of the image in the file.