Post a Feed Element with a New File (Binary) Attachment
Call a method to post a feed element with a new file.
In version 36.0 and later, you can’t post a feed element with a new file in the same call. Upload files to Salesforce first, and then specify existing files when posting a feed element.
This example calls postFeedElement(communityId, feedElement, feedElementFileUpload) to post a feed item with a new file (binary) attachment.