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

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
yashag2255
Dual Super User II
Dual Super User II

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!

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. 😞

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (864)