How to do binary attachments from server side through gateway to couch-base lite?

That’s right. There isn’t an SDK API that allows you to directly add attachments to documents. You have the option of embedding it as base64 encoded field associated with document or just uploading the binary blob as a document . FYI - related blog. The recommended approach is to store the binary data is an external store and reference it from the database instead of storing it in line - this is especially true for large attachments.

OK. So looks like you used out one of the alternate approaches mentioned above. If the document is added to the CB bucket but isn’t getting processed by SGW, then check your import function in SGW config file.

In fact, please share your SGW config file.

Are you providing the right credentials and is there anything in your SGW config file sync function that may be preventing this upload ? Because you should be able to create a document and PUT an attachment .
Please share the exact request that you are using for creating the attachment via the SGW API.

You have to provide the right revision Id of the document that you trying to update via the “rev” parameter.