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 / Corrupted Attachments ...
Power Automate
Suggested Answer

Corrupted Attachments in SP folder and on email

(0) ShareShare
ReportReport
Posted on by 8

Hello, I’m encountering an issue in a flow I’m building where I collect images through a group form. When these images are saved to SharePoint, I’m unable to open them as they show a "files not supported" error. I also attempted to send the files via email; while some generate previews successfully, others appear to be corrupt.

Literally spent 2 days and counting now trying to figure out. Any insights or guidance would be greatly appreciated. Thank you in advance!

PS: I'm a rookie in Power Automate 

 

Categories:
I have the same question (0)
  • AlexEncodian Profile Picture
    4,409 Moderator on at
    can you check that your name dynamic value is the name including the file extension?
  • Suggested answer
    Ellis Karim Profile Picture
    11,931 Super User 2026 Season 1 on at
     
    Please check the following:
     
     
    Sometimes attachments just won't open. If this case, you may need to enter the following expressions for the “contentBytes” property:
     
    
    {
      "name": items('Apply_to_each')?['name'],
      "contentBytes": {
        "$content-type": body('Get_file_content_using_path')?['$content-type'],
        "$content": body('Get_file_content_using_path')?['$content']
      }
    }
     
    For more info, please see:
     
    Ellis
  • RB-28111619-0 Profile Picture
    8 on at
    @EKarim I tried the same process but the issue is still the same. I up
    But in the email, one of the files (first file) is corrupted. Whereas in the sharepoint library, all of the images I uploaded gave me this:
     
  • RB-28111619-0 Profile Picture
    8 on at
    @EKarim in the link you shared, I saw you added a compose action. Could you pls share what's inside this action?
  • RB-28111619-0 Profile Picture
    8 on at
    @AlexEncodian hello, I'm afraid no. I'm not sure what would be the expression. Appreciate if you could show me please. 
  • RB-28111619-0 Profile Picture
    8 on at
    I used this in my array variable and it seems to be working.

    {
    "Name": "@{concat(items('Apply_to_each')?['name'], '.', items('Apply_to_each')?['fileExtension'])}",
    "ContentBytes": {
    "$content-type": "@{body('Get_file_content_using_path')?['$content-type']}",
    "$content": "@{body('Get_file_content_using_path')?['$content']}"
    }
    }
  • Ellis Karim Profile Picture
    11,931 Super User 2026 Season 1 on at
    @EKarim in the link you shared, I saw you added a compose action. Could you pls share what's inside this action?

    Hi @RB-28111619-0
     
    Sorry, that compose action is not needed for the flow. I used it to display some debug info to ensure the flow worked correctly when writing the blog. I've removed it to avoid confusion:

     
    Ellis

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 67

#2
David_MA Profile Picture

David_MA 64 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard