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
goodtest123goodtest123 

Is there an example as to how to upload a file via webservices to a chatter feed?

Is there an example as to how to upload a file via webservices to a chatter feed?

Jordan@BracketLabsJordan@BracketLabs

Depends on where you are trying to post FROM: Various solutions can work via another language (non-SF native) to post the file into the WS API via say: Java, .NET or Rails(???) -- because you can base64 encode the file before the send (SOAP has a 50 mb limit...?)

 

From withing Salesforce: It's my understanding that uploading files for a 'content post' to Chatter isn't possible via SOAP webservices (there is no programmatic way to convert the files to to base64 encoding before inserting them either with Javascript or Apex.

 

Within Apex/Visualforce I haven't found a solution that logically solves the issue of creating a 'content feed post' without using the rather ridged Visualforce 'chatter' component.

 

It's possible that the Chatter REST API can accept a 'file-upload', but I don't know of an example that outlines creating a content post (might need more investigation here).