+ Start a Discussion

How to download attachments of FeedComments



I want to download the attachments from the FeedComments. I am able to get the ContentData from the ContentVersion Object with reference to RelatedRecordId. Issue is to create the file I also need to know the name of the attachment and type of the attachment like txt, jpg etc. Kindly let me know how can i get the ContentName.


query I'm using: SELECT VersionData From ContentVersion WHERE Id = RelatedRecordId.

Jia HuJia Hu
FileType is defined by either ContentUrl for links or PathOnClient for documents, but not both (see the ContentVersion Object).

File name is the Title field of the ContentDocument Object.
Get the ContentDocumentId field on the ContentVersion object and then query the ContentDocument object to get the Title by the ContentDocumentId.