web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send Email attachment ...
Power Automate
Answered

Send Email attachment from uploaded via Forms - files become corrupt in email

(0) ShareShare
ReportReport
Posted on by 35

Dear community

 

I face the issue with my flow which generally allows the users to submit a form with multiple attachments. The triggered flow will  first store the attachments locally in OneDrive/Apps/.... before a file array links the corresponding files as an attachment to an email.

 

The uploaded files can be opened in the local OneDrive/Apps/ folder, but become corrupt when sent as an email attachment. 

 

For example a pdf throws this error:

TM3K_0-1634732476771.png

 

A word file throws this error:

TM3K_1-1634732765754.png

 

After clicking Yes, the following message pops:

TM3K_2-1634732821554.png

 

I use the following array 'FileArray'

TM3K_4-1634732925614.png

 

And the following JSON:

TM3K_8-1634733366172.png

 

JSON Schema:

 

{
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "name": {
 "type": "string"
 },
 "link": {
 "type": "string"
 },
 "id": {
 "type": "string"
 },
 "type": {},
 "size": {
 "type": "integer"
 },
 "referenceId": {
 "type": "string"
 },
 "driveId": {
 "type": "string"
 },
 "status": {
 "type": "integer"
 },
 "uploadSessionUrl": {}
 },
 "required": [
 "name",
 "link",
 "id",
 "type",
 "size",
 "referenceId",
 "driveId",
 "status",
 "uploadSessionUrl"
 ]
 }
}

 

 

Further, I add the "Name" and “ContentBytes" to the array:

TM3K_6-1634733004543.png

 

Finally, I use the FileArray for the attachment of the mail:

TM3K_10-1634733785688.png

 

 

TM3K_9-1634733690194.png

 

However, the files become corrupt. Any idea why this may happen? I have checked many posts already, but could not find any solution which worked for me.

 

Thanks

TM3K

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at

    Here is part of a form showing multiple files that have been uploaded:

    2021-10-22_00-19-49.png

     

    The loop to process the forms attachment should resemble the following:

    2021-10-21_23-57-38.png2021-10-22_00-13-31.png

    Hope this helps


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard