cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Balony
Frequent Visitor

email attachment bad encoding

Whem 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:
original_file.png

 

The file recivied in the e-mail looks like:

received_file.png

 

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

The mail sending:

image.png

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
Balony
Frequent Visitor

Re: email attachment bad encoding

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.

 

It would be great to have  'binary' type variables in flow.

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User
Dual Super User

Re: email attachment bad encoding

HI @Balony 

 

First: In the Attachment name you need to end the name of the attachment with the .pdf extension else thsi will show error everytime. Please confirm this.

Second: you are passing the content as a string and so it is messing that up. You need to put the content in binary(content) and then pass it in the variable and then to the attachment content. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Balony
Frequent Visitor

Re: email attachment bad encoding

Thanks for the advice,

 

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

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

   
binary(body('Get_attachment_content'))

    but it did not help. 😞

Community Support
Community Support

Re: email attachment bad encoding

Hi @Balony ,

 

Could you share all the screenshots of the Flow configuration?

As far as I know, the files transferred in Flow will eventually retain the type and content of the file.

Flow does not actively encode files during execution.

Please provide more details so that we could analyze your problem.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Balony
Frequent Visitor

Re: email attachment bad encoding

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.

 

It would be great to have  'binary' type variables in flow.

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,161)