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

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

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard