cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert PNG/JPG attachment to base64 and send it via business rule

Filip_Zarnovicky
Participant
0 Kudos
1,064

Hello FSM experts,

I need advice regarding an issue of converting PNG/JPG attachments to base64 format for integration purposes in SAP FSM. In my current setup, I use business rule to extract an attachment through the Get Attachment API, convert it to base64, and send it to another system via an API call. For the past 3 years, my way has worked fine. However, over the last few days, the base64 conversion has stopped work correctly—it seems to replace characters like 'i' with '/' and possibly more (e.g. MIME-type "iVBOR" (means PNG type) changed to "/VBOR").

At present, I am using JavaScript to handle the conversion directly within the second API call. I would like to ask the community: what methods or practices do you use to convert attachments to base64 in similar scenarios? Are there any reliable alternatives you use and work event these days?

Example of JS conversion to base64 is in attachment.

Thank you in advance for your insights!

Filip

View Entire Topic
Filip_Zarnovicky
Participant
0 Kudos

Solution from SAP Support, use new API to get attachment:

https://eu.fsm.cloud.sap/cloud-attachment-service/api/v1/Attachment/$ {attachment.id}/content?dtos=Attachment.18&account=${account.name}&company=${company.name}

instead of the previous version:

https://eu.coresuite.com/api/data/v4/Attachment/{attachment.id}/content?dtos=Attachment.18&account=${account.name}