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 / Attachment is corrupte...
Power Automate
Unanswered

Attachment is corrupted when sent through manual trigger

(0) ShareShare
ReportReport
Posted on by 1,115

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
    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,115 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
    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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard