How to Fix Power Automate Saving Empty Email Attachments to OneDrive
Question details
Users need to correct a Power Automate flow that creates zero-byte attachment files in OneDrive that cannot be opened.

- 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 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.
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.
Log in to Power Automate, navigate to 'My flows', select the flow responsible for saving the attachments, and click 'Edit'.
Scroll down to the 'Create file' action for OneDrive within your flow steps.
Click inside the 'File Content' input box to bring up the Dynamic content menu. Remove any existing tags like 'Attachment Name' or 'Id'.
From the Dynamic content list, search for and select 'Attachments Content' or 'ContentBytes' (depending on the specific email trigger you are using).
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.

Seek Assistance from the Power Automate Community
If adjusting the file content mapping does not resolve the issue, complex flow structures may require expert inspection.
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. Download WPS Office: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the Suite: Run the setup file and follow the quick on-screen instructions to install the application.
- 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.

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.




