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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attachment is corrupte...
Power Automate
Answered

Attachment is corrupted when sent through manual trigger

(0) ShareShare
ReportReport
Posted on by 1,129

I have a very simple flow with manual trigger where am trying to attach a file. I am sending the attachment through send an Email(v2) action and attachments go through fine when I pass file name and content like below

 

RameshMukka_0-1645089782583.png

Now when I want to use a array variable like below, the email attachments are sent but came as corrupted. I have been struggling for hours to find my mistake but couldn't solve it. Can someone help me please?

 

RameshMukka_1-1645090149027.png

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @RameshMukka,

    Could you please share the complete flow configure with me?

     

    If you want to use the Appen to array, you should append all the attachment value to the array variable which we initialized before. Fill the fields as follows:

    • Name – attachments
    • Value – {

                     “Name”: “Use Dynamic content – Display Name”
                     “ContentBytes”: “Add Expression – body(‘GetContent’).$content

                            }

    The ContentBytes parameter holds the actual attachment.

     

    In a word, if you use the append to array, you should format your attachments as an array using the attachment display name and content, which could be captured using the Get file content. Then you could get the file name with extension for Name parameter and file content for ContentBytes.

  • rameshmukka Profile Picture
    1,129 on at

    @v-qiaqi-msft 

    I am using the trigger "For a Selected File" from SharePoint and added a file parameter. The file content already coming from manual trigger. So I dont have to use Get-FileContent anywhere. Here is my flow. The file displayname and contentBytes both coming directly from attachments during manual trigger. As attaching file is optional for the requirement, the flow runs fine when there is an attachment but fails when there is no attachment because attachment name and content in Send an Email (V2) cannot be blank so I opted to use Array. I feel I format my attachments correct in the array. Don't know where else is the problem. Here is my flow.

    RameshMukka_1-1645441278262.png

    RameshMukka_2-1645441336449.png

    RameshMukka_3-1645441400952.png

     

     

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @RameshMukka,

    You should change the Base64 to binary:

    vqiaqimsft_0-1645511522753.png

    base64ToBinary(triggerBody()?['file']?['contentBytes'])
    
    

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard