cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sherif77
Helper II
Helper II

SharePoint added PDF Files were Sent corrupted as Email Attachments

Hello Everyone,

I hope you could assist to resolve the following issue,

I have a SharePoint Library that i need to generate automated Email once a PDF file is added to the library. ( the email will be sent to recipients outside our organization)

I have started my flow from basic Microsoft Template "Send a customized email when a new file is added" though its not working as the PDF files usually were sent corrupted.

 

Please advice bearing in mind that the PDF files in the SharePoint library were added under column named "Name" which may 

 

I used so far the following actions 

 

  1. when a new file is created ( properties only}
  2. Get file Metadata
  3. Get file content
  4. get my profile V2
  5. send Email V2

 

Corrupted Attachments.PNG

 

Your utmost support on this regards is highly appreciated,

 

Thank for your usual Support, 🙂

 

Regards,

Sherif

10 REPLIES 10
sherif77
Helper II
Helper II

Further on the below,

 

Corrupted Attachments 1.PNG

Hi @sherif77,

 

Please try to use base64() function convert the file content into base64 format, for example:

Annotation 2020-06-16 181014.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The Flow Checker Doesn't like the expression

 

 Corrupted Attachments 2.PNG

Hi @sherif77,

 

Could you share the configuration?

You could past the following expression directly in the field:

@base64(body('Get_file_content'))

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-litu-msft 

Okay now its gibberish flow checker didn't point on any problem with the base 64 expression, however its pointing on the Metadata connector.

Which file identifier I should be using under " Get file Metadata" the documents column is " Name"

 

Corrupted Attachments3.PNG

 

Corrupted Attachments 4.PNG

 

Hi @sherif77,

 

When you get the file metadata and content, the dynamic content Identifier should be the correct selection to appended in the File identifier field:

Annotation 2020-06-19 171500.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-litu-msft 

 

Thank you it passes the Metadata now I'm getting again the Email with a corrupted PFD file. Any suggestions ?

 

Reagrds,

Sherif.

 

 

 

 

 

Hi @sherif77,

 

It's weird, I tested on my side and it works perfectly, how about you use the Get file properties action to try it again?

Annotation 2020-06-23 170920.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-litu-msft  

I have tried this one too but its not sending the attachment properly its still corrupted. the error I'm receiving when i open the PDF file is saying "Wrong PDF Decoded"

 

 

Corrupted Attachments3.PNG

 

 

@v-litu-msft   any further Solutions here ..

 

Appreciating your help here

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,725)