I'm trying to get the body of an Attachment object in Salesforce so I can provide it to the user via utils.downloadFile(). After a lot of research and trial and error it seems it is possible to access this through a Salesforce CRUD Action with:
CRUD Action = Retrieve
Resource Type = Attachment
Resource ID = /Body
Per this Salesforce documentation, this request will return the binary content of the attachment. However this seems to be getting converted to ASCII data before I can access it. The query.data field is:
result:
It's not base64 encoded, and I can't figure out any way to serve it to the user as a file that's not corrupted.
Is there another way to access binary data from Salesforce? I'm considering connecting the Salesforce REST API directly as described here, but I'd rather not do that if I don't have to.