Mastering OneDrive Sync Client Large‑File Uploads with Chunked Transfer
Learn how OneDrive Sync Client splits large files into 320 KB chunks, how to enforce a smaller chunk size with Group Policy, and how to verify the behavior with PowerShell. Understand trade‑offs and get a step‑by‑step example.
31 Aug 2025, 18:54 UTC

Why Chunked Uploads Matter for OneDrive Sync
When a user syncs a 10 GB file, the OneDrive Sync Client must split the data into smaller pieces to keep the network connection stable and to allow the upload to resume after a hiccup. The underlying REST API uses an /uploadSession endpoint that returns a unique uploadUrl and a Upload-Offset header. This mechanism is the backbone of the client’s resilience, but admins often overlook the configuration knobs that control chunk size, memory usage, and progress visibility.
Key Concepts and Terminology
- Upload Session – A short‑lived URL created by POSTing to
/uploadSession. The client uses this URL to send each chunk. - Chunk – A contiguous block of the file, normally 320 KB, but negotiable by policy.
- Upload‑Offset – The byte position the server has already received. The client sends this value with each PUT request.
- Progress Event – A local event the Sync Client fires every time a chunk is written to disk or sent; useful for custom dashboards.
Configuring Chunk Size with Group Policy
By default the client chooses a 320 KB chunk size. On low‑end devices or constrained networks, you can enforce a smaller size to reduce RAM consumption. The policy path is:
Computer Configuration\Administrative Templates\OneDrive\Maximum upload chunk size (bytes)
Set it to 131072 (128 KB) for a conservative profile. Remember that smaller chunks increase the number of HTTP requests, which can slightly raise overall upload time.
Practical Verification
After applying the policy, restart the Sync Client or reboot the machine. Verify the new chunk size by inspecting the client log located at %LOCALAPPDATA%\Microsoft\OneDrive\logs\OneDriveClient.log. Look for lines similar to:
Chunk size set to 131072 bytes
If the log shows the default 327680 bytes, the policy did not apply – check that the policy is linked to the correct OU and that the client is up to date.
Using PowerShell to Trigger a Chunked Upload
Below is a safe, non‑destructive example that demonstrates how to start a chunked upload via PowerShell. Replace <YourTenantID> with your Azure AD tenant ID and ensure the account has the Files.ReadWrite.All scope.
# Install the Microsoft.Graph module if needed
Install-Module Microsoft.Graph -Scope CurrentUser -Force
# Connect and obtain an access token
Connect-MgGraph -Scopes "Files.ReadWrite.All"
# Create a 10 GB test file (placeholder – do not actually create this size on a test machine)
$path = "C:\\Temp\\largefile.bin"
# New-Item -Path $path -ItemType File –AsJob # Skipped for safety
# Start an upload session
$uri = "https://graph.microsoft.com/v1.0/me/drive/root:/largefile.bin:/createUploadSession"
$body = @{ "item" = @{ "@microsoft.graph.conflictBehavior" = "replace" } }
$response = Invoke-MgGraphRequest -Method POST -Uri $uri -Body $body
$uploadUrl = $response.uploadUrl
# Read the file in 320 KB chunks and upload
$chunkSize = 320 * 1024
$bytes = Get-Content -Path $path -Encoding Byte -ReadCount $chunkSize
$offset = 0
foreach ($chunk in $bytes) {
$headers = @{ "Content-Range" = "bytes $offset-$(($offset + $chunk.Length - 1))/$(Get-Item $path).Length" }
Invoke-WebRequest -Uri $uploadUrl -Method PUT -Headers $headers -Body $chunk
$offset += $chunk.Length
}
In a real deployment you would replace the file creation step with your actual data source. The loop demonstrates how the client would send each chunk and update the Content-Range header accordingly.
Trade‑Offs and Limitations
- Memory vs. Network Load – Smaller chunks reduce peak memory but increase the number of HTTP requests, potentially raising the chance of transient failures.
- Token Expiry – The upload session relies on an Azure AD access token. If the session exceeds the token lifetime (typically 1 hour), the client must refresh the token; long‑running uploads can fail if not handled.
- Local Disk Space – Each chunk is stored temporarily on disk. On devices with limited free space, the sync may pause until space is freed.
- Policy Enforcement – Group Policy changes require the client to restart. Delayed policy propagation can lead to inconsistent behavior across an organization.
Actionable Takeaways
- Enable the
Maximum upload chunk sizepolicy to 128 KB if you have a fleet of low‑spec laptops. - Monitor
OneDriveClient.logto confirm the policy is applied and to troubleshoot any unexpected chunk sizes. - Use the PowerShell script as a template to build custom upload workflows that need fine‑grained progress handling or integration with other services.
- Plan for token renewal in long‑running uploads by scheduling periodic
Connect-MgGraphcalls or by wrapping the upload loop in a retry mechanism that checks for 401 responses. - Allocate sufficient local disk quota for temporary files; consider configuring the
OneDriveTempPathpolicy if you need to redirect temp storage.
By understanding how the Sync Client negotiates chunked uploads, configuring the right policy settings, and validating the behavior with a controlled test, you can ensure large files sync reliably across your organization, even in flaky network conditions.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.