Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Corrupted Attachments in SP folder and on email

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 

 

  • EKarim Profile Picture
    EKarim 10,232 on at
    Corrupted Attachments in SP folder and on email
    @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
  • RB-28111619-0 Profile Picture
    RB-28111619-0 8 on at
    Corrupted Attachments in SP folder and on email
    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']}"
    }
    }
  • RB-28111619-0 Profile Picture
    RB-28111619-0 8 on at
    Corrupted Attachments in SP folder and on email
    @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
    RB-28111619-0 8 on at
    Corrupted Attachments in SP folder and on email
    @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
    RB-28111619-0 8 on at
    Corrupted Attachments in SP folder and on email
    @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:
     
  • Suggested answer
    EKarim Profile Picture
    EKarim 10,232 on at
    Corrupted Attachments in SP folder and on email
     
    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
  • AlexEncodian Profile Picture
    AlexEncodian 4,235 on at
    Corrupted Attachments in SP folder and on email
    can you check that your name dynamic value is the name including the file extension?

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard