When I send an e-mail attachment with flow, the files get corrupted.

I guess it is sending in wrong encoding.

The original file looks like: enter image description here

The file received in the e-mail looks like: enter image description here

I have tried the "Get file content" and the "Get attachments content" actions, but without luck.

The mail sending: enter image description here

Can anyone help me how to acheive the right encoding or recommend me a better way to send the files?

  1. the filename is with extension .pdf, this is OK

  2. I have tried passing the content trought the binary() function:


but it did not help.

2 Answers 2


Problem solved,

if I pass the body('Get_attachment_content') directly to the 'attachments Content' it is working well, but if I put the body('Get_attachment_content') to a string variable, and this variable to the 'attachments Content' it is corrupting the encoding, maybe because the string variables in the flow are encoded in UTF-8.


I worked through an issue similar to this with a coworker. We were trying to get the attachments of an item and attach them to an email/approval. When we opened the attachment, the file was corrupted.

Since we knew that there was only going to be one attachment per item, we used an expression to call the ID from first result of the Get Attachments action in the Get Attachment Content action. Expression from Get Attachment Content

Then we saved the Display Name of the file to a variable using the method from the screenshot before. We'll use this variable later. Expression for the variable to save the Display Name

We then used the content results from the Get Attachment Content as the attachment and the display name from the variable to build the attachment to the email.
Sending the email/approval with attachment

I hope this helps anyone else that comes across this issue too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.