cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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 III
Dual Super User III

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!

Highlighted
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.
Highlighted
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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,809)