I am trying to import many articles from another system via REST api. I managed to create simple ones without additional (binary) resources. It works fine.

But it is not very clear how to deal with binary data. I've tried to specify image in form of data-uri with Base64 data, but in this case a default 32K limit of my rich text field is exceeded very quickly. It can be extented to 128K, but it is still too low.

So far I only found this link for uploading binary attachment, but it is not very clear whether applicable in my case. http://blog.enree.co/2013/01/salesforce-apex-post-mutipartform-data.html

Btw initially I also tried the bulk import via crafted CSV file, but in this case I couldn't update the already existing articles (which is requested in my case), hence the REST way.


2 Answers 2


We face a similiar problem, we create all our content outside salesforce (like to keep our tech. writers in the company) in HTML format.

Our initial idea was to store the image (or whatever) in a richtext field (the one of 128kb) on a different article. The original article also using a richtext field to store the HTML.

The SRC/IMG in the HTML should than point to the image article public url. After some prototyping this seems to work (downside: it works only after publication of the article since than the public url will become available as it seems).

However the 128kb limit (maybe introduce a blob field type??) is still buggin me and now I am looking into salesforce documents who do seem to support normal sizes. The advantages also being that there are high limits on document storage.

I still need to find the time to look into this further, hopefully some other alternative will pass too. I am open for any other ideas to store for example a 600kb pdf with embedded viewing :). Hope this helps a bit.

Cheers, Robin


I have a similar issue, and the only solution I can think of is to upload the images as a ContentDocument, and then link to the image like so:

<img src="/sfc/servlet.shepherd/version/download/<contentVersionId>" />

This works, but as far as I know, the link "/sfc/servlet.shepherd/version/download/" is not officially supported.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .