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 / Save Outlook mail atta...
Power Automate
Answered

Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

(0) ShareShare
ReportReport
Posted on by 13

A flow has been prepared in such a way that all the attached files through the outlook mails are saved in a specific folder of SharePoint site and it is working fine. But the size of all the saved file is becoming 4 bytes. as a result none of the files are opening.

 

arindamsarma_1-1715668986367.png

Any email arrives.

 

arindamsarma_0-1715668949672.png

Attachment is copied to a specific SharePoint folder.

 

arindamsarma_2-1715669074723.png

All the files are saved with a fixed size of 4 bytes.

 

Please guide me with a solution.

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @arindamsarma ,

     

    I recommend you switch to classic designer and test again. The file created in new designer can't open sometimes.

     

     

    Best regards,

    Rimmon

  • arindamsarma Profile Picture
    13 on at

    Thank you for your quick response. I have switched to classic designer and tested but still the problem remains same. all the file size is becoming 4 bytes and not opening the file.

    arindamsarma_0-1715672900730.png

    Here is the screen shot.

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @arindamsarma ,

     

    It's wired.🤔 In my test, I add a Get attachment action and use name and content from it to create file, the file can be opened. I am looking for what is the difference cause this problem. I recommend you try this first.

    vmengmlimsft_0-1715674511709.png

     

     

    Best regards,

    Rimmon

  • arindamsarma Profile Picture
    13 on at

    Yes, it is done. Thank you.

  • arindamsarma Profile Picture
    13 on at

    Could you please guide with the required modification in the flow, how can I change name of the attachment before saving it in the SharePoint.

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @arindamsarma ,

     

    You can add name manually instead of using dynamic content. 

    Note: Don't forget file extension.😀

    vmengmlimsft_0-1715680578813.png

     

    ——————————————————————————————————————————————————

    If my previous answer helps you solve the problem, please accept it as a solution.

    If you have another problem, please post it in a new post.

     

    Best regards,

    Rimmon

  • arindamsarma Profile Picture
    13 on at

    Yes, how to manage extension, because name of the file can be anything but the extension should be the same as the original file. Please suggest if there is any function to identify the exact extension of the original attachment file.

  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @arindamsarma ,

     

    You can use split to get file extension.

    concat('.',last(split(<dynamic value>,'.')))

    Above expression can get '.pdf', '.docx', etc.

     

     

    Best regards,

    Rimmon

  • arindamsarma Profile Picture
    13 on at

    Can I get the dynamic value from the dynamic content directly?

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @arindamsarma ,

     

    Of course, the <dynamic value> in my provided expression just an example, it stands for file name you can get in the flow. You can replace it with dynamic content which is file name with extension.

     

    Best regards,

    Rimmon

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard