I'm wondering how can i display my attachment and its miniature in front of the title in lightning component ? is there a component that does the job ?
-
Could you clarify when you say miniature, if you are referring to see a preview of the file in a lightning component?– Jayant DasCommented Mar 29, 2019 at 16:12
-
It's like what is shown in the picture , like an avatar but its displays a preview of the attachment.– SaraCommented Mar 29, 2019 at 16:14
Add a comment
|
1 Answer
You can use lightning:fileCard
here which does exactly what you want, i.e., displays a preview of a file.
A
lightning:fileCard
component displays a preview of a file....
The file type determines the icon used on the file preview and caption area.
The component is used as below, where the fileId
value must be a valid 15 character ContentDocument ID.
<lightning:fileCard fileId="xxxx" description="Description"/>
-
Do you have any idea why its doesnt work it shows me no preview available ?– SaraCommented Mar 29, 2019 at 16:56
-
Which experience are you viewing the file in? You may like to check the documentation to see if that may be the reason Commented Mar 29, 2019 at 16:59
-
I'm using it in opportunity object and the file is stored in attachments– SaraCommented Mar 29, 2019 at 17:01
-
1Okay I think the component only supports
ContentDocument
Commented Mar 29, 2019 at 17:11