cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Balony
Level: Powered On

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
Level: Powered On

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
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
Level: Powered On

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 Team
Community Support Team

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
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,058)