File upload failed – The file could not be uploaded during flow execution

Loading

Power Automate allows file uploads to SharePoint, OneDrive, Dataverse, and other cloud storage services. However, sometimes the flow fails to upload a file due to various issues.

This guide explains:
Why file upload failures happen.
How to diagnose the issue.
How to fix common file upload problems.


Step 1: Understanding Common File Upload Errors

1.1. Common Causes of File Upload Failures

CauseDescription
File size exceeds limitThe file is larger than the allowed upload size.
File path too longSharePoint and OneDrive have limits on file path length.
Insufficient permissionsThe flow does not have write access to the destination folder.
File name contains invalid charactersSome characters are not allowed in file names (e.g., `? * ” < >
File already existsThe destination does not allow overwriting files.
Network or API limitationsConnectivity issues or API rate limits prevent the upload.
Corrupt file or encoding issuesThe file content may be unreadable or improperly formatted.

Step 2: Diagnosing File Upload Failures

2.1. Check the Flow Run History

  1. Open Power Automate (https://make.powerautomate.com).
  2. Click on My Flows → Select the affected flow.
  3. Go to Run History → Open a failed run.
  4. Look for error messages such as: File upload failed: File size exceeds limit. cssCopyEditThe file could not be uploaded due to insufficient permissions.
  5. Expand the action details to see:
    • File size
    • File path
    • Error message

Step 3: Fixing Common File Upload Errors

3.1. Fix File Size Exceeds Limit

Each storage service has file size restrictions.

Storage ServiceMax File Size (Standard Plan)Max File Size (Premium Plan)
SharePoint250 MB15 GB
OneDrive250 MB15 GB
Dataverse128 MB512 MB
Power Automate Attachments100 MB150 MB

Solutions

Compress the file before uploading (ZIP format).
Split large files into smaller chunks.
Use Azure Blob Storage for files larger than 15 GB.


3.2. Fix File Path Too Long

SharePoint and OneDrive limit file paths to 400 characters.

Solutions

✅ Store files in a higher-level folder (e.g., use /Documents/ instead of /Sites/LongFolderName/Subfolder/).
✅ Shorten the file name before uploading.
✅ Use the “Replace” function to trim long file names:

replace(triggerOutputs()?['body/Name'], ' ', '_')

3.3. Fix Insufficient Permissions

If the flow does not have write access, it cannot upload files.

Solutions

Check if the flow owner has permission to upload files:

  • Go to SharePoint/OneDrive → Right-click the folder → Manage Access.
    ✅ If the flow runs under a service account, ensure it has write access.
    Re-authenticate the connection in Power Automate:
  1. Go to Data > Connections.
  2. Find the storage service (e.g., SharePoint).
  3. Click Reconnect.

3.4. Fix Invalid File Name Characters

Some characters are not allowed in file names.

Invalid CharactersRestricted In
`\ / : * ? ” < >`
# %SharePoint URLs
:Mac OS

Solutions

✅ Use Power Automate expressions to clean file names:

replace(replace(replace(triggerOutputs()?['body/Name'], '/', ''), '*', ''), '"', '')

3.5. Fix File Already Exists Issue

If the destination folder does not allow overwriting, uploads will fail.

Solutions

✅ Enable file overwriting:

  • In Power Automate, check the “Create file” action.
  • Set “If file exists” to Replace.
    ✅ Append a timestamp to the file name to create a unique version:
concat(triggerOutputs()?['body/Name'], '_', utcNow(), '.pdf')

3.6. Fix Network or API Rate Limits

Power Automate and cloud services have request limits. If exceeded, uploads may fail.

ServiceRate Limit
SharePoint API600 requests per minute
OneDrive API100 requests per minute
Dataverse API1,000 API calls per hour

Solutions

Use Retry Policies in Power Automate:

  • Open “Create File” action → Click Settings → Enable Retry Policy.
    Add a delay between uploads:
  • Insert a “Delay” action for 5-10 seconds between file uploads.

3.7. Fix Corrupt File or Encoding Issues

If a file is corrupt or has an incorrect format, it may fail to upload.

Solutions

Check file format before uploading.
Re-upload a manually saved version to test if the file is valid.
✅ Convert files to Base64 encoding before sending:

base64(triggerOutputs()?['body'])

Step 4: Preventing Future File Upload Failures

4.1. Best Practices

Limit file size – Use compression and chunking for large files.
Validate file paths and names – Ensure they meet SharePoint and OneDrive restrictions.
Check user permissions – Ensure the flow has write access to the upload folder.
Enable overwrite or versioning – Prevent duplicate file issues.
Use retry policies – Handle API rate limits and network issues.
Monitor flow run history – Detect file upload failures early.

4.2. Set Up Alerts for File Upload Failures

  1. Open Power AutomateMy Flows.
  2. Click Edit Flow → Add a “Send an email” action after file uploads fail.
  3. Configure the email to alert users about failed uploads.

Leave a Reply

Your email address will not be published. Required fields are marked *