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
PremInfoPremInfo 

How to download attachments of FeedComments

Hi, 

 

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.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_contentdocument.htm