Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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.

  • v-mengmli-msft Profile Picture
    on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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

  • arindamsarma Profile Picture
    13 on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

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

  • Verified answer
    v-mengmli-msft Profile Picture
    on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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.

  • v-mengmli-msft Profile Picture
    on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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.

  • arindamsarma Profile Picture
    13 on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    Yes, it is done. Thank you.

  • v-mengmli-msft Profile Picture
    on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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
    on at
    Re: Save Outlook mail attachments in a SharePoint folder is working but the saved file size is always 4 bytes

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow