You need to sign in to do that
Don't have an account?
bhuvana das
How to download the attachments of the record in lightning component?
How to download the "Attachements" which are queried and displaying on custom component. or is there any lightning component for download the attachments (we don't want to use standard things) in napili community template.
On your apex server side code you need to select the attachment object -> all the attachments of the selected objects ids.
Create a wrapper apex class that will represent 1 record with a list of attachments and prepare your data so each record has a list of attachments. Then send a list of this wrapper class back to the client (you can do this also on the client side javascript and not from the server).
on your client side markup you should define an attribute from the wrapper class, and have an aura:iteration for each record, and inside another aura:iteration for the attachments in each record: Displaying the downloadable links - you can do in many ways - for example, I display download links like that (where att is the iteration variable): Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra