Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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

 

 

 

  • Verified answer
    Ellis Karim Profile Picture
    11,120 Super User 2025 Season 1 on at
    Re: Send Email attachment from uploaded via Forms - files become corrupt in email

    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1