logo
search
OneDrive File Issues

How to Fix Power Automate Saving Empty Email Attachments to OneDrive

Huda QurayshiHuda Qurayshi Oct 7, 2026 871 views

Question details

Users need to correct a Power Automate flow that creates zero-byte attachment files in OneDrive that cannot be opened.

How to Fix Power Automate Saving Empty Email Attachments to OneDrive
Product
Power Automate, OneDrive
Device & OS
not provided
Scenario
Automating the process of extracting incoming email attachments and saving them directly to a specified OneDrive folder.
Observed behavior
The Power Automate flow runs successfully and generates files in OneDrive, but the files contain no data (zero bytes) and prompt an error when users attempt to open them.
Before you start

Before modifying your Power Automate flow, ensure you have edit permissions for the workflow and temporarily turn the flow off to prevent failed runs while you apply the fix.

Solution 1Recommended

Map the Attachment Content or ContentBytes Value

The most common cause for empty files is mapping the attachment's Name or ID instead of its actual binary content in the 'Create file' action.

When configuring a flow to save files, Power Automate requires the actual file data to write to the destination. If only the metadata (like the attachment name) is provided to the 'File Content' field, the system creates an empty shell of the file.

1
Edit the Power Automate Flow

Log in to Power Automate, navigate to 'My flows', select the flow responsible for saving the attachments, and click 'Edit'.

2
Locate the Create File Action

Scroll down to the 'Create file' action for OneDrive within your flow steps.

3
Update the File Content Field

Click inside the 'File Content' input box to bring up the Dynamic content menu. Remove any existing tags like 'Attachment Name' or 'Id'.

4
Select the Correct Dynamic Content

From the Dynamic content list, search for and select 'Attachments Content' or 'ContentBytes' (depending on the specific email trigger you are using).

5
Save and Test

Click 'Save' at the top right, turn your flow back on, and trigger a test by sending an email with an attachment to verify the file saves properly.

Map the Attachment Content or ContentBytes Value
Check Trigger Settings: If you are using the 'When a new email arrives' trigger, ensure that 'Include Attachments' is set to 'Yes' under the advanced options. Otherwise, the flow will not retrieve the ContentBytes.
Free Microsoft Office alternative

Looking for a Seamless Office Experience? Try WPS Office

While troubleshooting complex Microsoft automation flows, you might want a straightforward and highly reliable Office suite for your everyday tasks. WPS Office provides a lightweight, highly compatible alternative for handling documents, spreadsheets, and presentations without the hassle of complicated setups.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install the Suite: Run the setup file and follow the quick on-screen instructions to install the application.
  3. 3. Open Your Files: Double-click any Word, Excel, or PowerPoint attachment you saved from your emails to instantly view and edit them in WPS Office.
Fully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight application that runs smoothly and quickly on any deviceOpen your newly downloaded OneDrive attachments effortlesslyFree to use with a familiar, user-friendly interface for seamless migration
microsoft office alternative - wps office

Frequently Asked Questions

Why do my downloaded OneDrive attachments show as 0 bytes?

This happens when the Power Automate flow creates the file using only the attachment's metadata (like its name or ID) instead of the actual binary data. Without the 'ContentBytes', the system creates an empty file.

Does 'Include Attachments' need to be enabled in my email trigger?

Yes. When using triggers such as 'When a new email arrives (V3)' in Office 365 Outlook, you must set 'Include Attachments' to 'Yes' in the advanced options. If set to 'No', the flow will not download the attachment's content data.

How do I test if my flow is actually capturing the attachment content?

You can verify this by checking the flow's Run History. Open a recent successful run, click on the email trigger or the 'Get Attachment' action to expand it, and review the raw outputs to ensure the 'ContentBytes' field is populated with data.