sharepoint Code Upload Failed Error

How to Fix SharePoint Error Upload Failed Error

Diagnostic Procedures

  • 1 Understand the Causes of SharePoint Upload Failures
  • 2 Step 1: Check File Name Restrictions and Path Lengths
  • 3 Step 2: Clean Local Office and Sync Cache Files
  • 4 Step 3: Verify File Size Restrictions on the Library
  • 5 Step 4: Restart Sync Daemons and Services

How to Fix SharePoint Error Upload Failed Error

The Upload Failed Error in SharePoint is a common error that occurs when a local file cannot be copied to the SharePoint cloud environment. This issue frequently shows error messages like “Upload Failed: Locked by another user”, “Upload blocked”, or “Upload failed: A server error occurred.”

This guide outlines how to audit file names, clear the Office file caches, verify upload thresholds, and restore synchronization.


Understand the Causes of SharePoint Upload Failures

Upload failures are typically triggered by:

  1. Unsupported Characters in Filenames: The file path or name contains reserved characters such as *, :, <, >, ?, /, \, or |.
  2. Path Length Limits: The combined site URL, library path, and filename exceed 400 characters.
  3. Office Cache Corruption: The Microsoft Office Document Cache (MSOSYNC) database is corrupted, preventing the application from sending incremental file blocks.
  4. File Size Boundaries: The file exceeds the maximum file size limit (currently 250 GB for SharePoint Online, but significantly lower in on-premises farms).
  5. Checked-out Status: The server library is waiting for mandatory checkout inputs, blocking direct file uploads.

Resolving SharePoint Upload Failed Errors

Follow these steps to clean your local cache and resolve upload conflicts:

Step 1: Check File Name Restrictions and Path Lengths

SharePoint will immediately reject files that violate file system naming rules.

  1. Ensure the filename does not start or end with a space.
  2. Remove the following characters from the name: ~, ", #, %, &, *, :, <, >, ?, /, \, {, |, }
  3. Keep the file path short. If the path is too long, move the file to a folder closer to the root of the synced library.

Step 2: Clean Local Office and Sync Cache Files

Corrupt databases inside the Office Document Cache can cause uploads to hang.

On Windows:

Run these commands in an administrator Command Prompt to terminate the cache client and delete the local databases:

:: Close active synchronization and Office processes
taskkill /f /im msosync.exe
taskkill /f /im onedrive.exe

:: Delete the Office File Cache folder
rmdir /s /q "%LocalAppData%\Microsoft\Office\16.0\OfficeFileCache"

On macOS:

Execute these terminal commands:

# Force quit Office file providers and OneDrive
killall "Microsoft OSF Provider" 2>/dev/null
killall "OneDrive" 2>/dev/null

# Clean cached SharePoint and Office components
rm -rf ~/Library/Containers/com.microsoft.SharePoint-mac/Data/Library/Caches/*
rm -rf ~/Library/Group\ Containers/UBF8T346G9.Office/OfficeFileCache-*

Step 3: Verify File Size Restrictions on the Library

If you are uploading large files (such as database files, archive folders, or videos), verify that the file size is within limits.

  • SharePoint Online: Max file size is 250 GB.
  • SharePoint Server On-Premises: The default limit is 250 MB, though admins can increase this up to 10 GB (SharePoint 2016/2019).

On-Premises Administrators (Increase Limit):

  1. Open SharePoint Central Administration.
  2. Under Application Management, click Manage web applications.
  3. Select your Web Application, and click General Settings in the ribbon.
  4. Scroll down to the Maximum Upload Size field and increase the value.
  5. Click Save.

Step 4: Restart Sync Daemons and Services

Relaunching the sync client restarts the network listener and triggers a delta check.

On Windows:

:: Restart OneDrive client services
%localappdata%\Microsoft\OneDrive\onedrive.exe /reset

On macOS:

# Restart the macOS OneDrive sync engine
open /Applications/OneDrive.app/Contents/Resources/ResetOneDriveAppStandalone.command

Summary Checklist

  • Rename the file to remove spaces, special characters, and long folder paths.
  • Confirm that the file size does not exceed the SharePoint library limits.
  • Clear the local Office File Cache using the terminal scripts above.
  • Discard any checked-out states on the server that might be locking the file.
  • Run the OneDrive reset command to refresh the upload daemon.