send email with pdf attachment using logic app : PDF is not getting opened. It got corrupted

1.2k Views Asked by At

enter image description here

Sending PDF in Base64 string, using json object. Converted Stream to Base64 before passing. Using Http trigger post for calling logic app enter image description here

Email are generated with pdf from logic app but PDF is not opening. Is Base64 content corrupted?

In Logic app, updated attachment content by ContentBytes => triggerBody()['attachments']?['ContentBytes'] and ContentBytes => base64(triggerBody()['attachments']?['ContentBytes'])

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

After some testing, you should use the base64ToBinary expression:

base64ToBinary(triggerBody()['attachments']?['ContentBytes'])