Problems copying .docx files to Sharepoint

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies.

I've run into an odd problem when copying Microsoft document files to sharepoint, the copy fails because the copied filesize doesn't match the source.
It seems to be related to the filename extension so .txt or .pdf files copy fine.  The problem only occures with .docx or .xlsx if I rename the destination file to .doc (or .xls) the copy works perfectly.  If I use --ignore-size --ignore-checksum the copy succeeds but the destination file is bigger than the source and analysing it using 7z to open the .docx shows that an extra folder has been added called [trash].  Not sure where to go with this...

What is the problem you are having with rclone?

Run the command 'rclone version' and share the full output of the command.

rclone v1.74.3
- os/version: Microsoft Windows 11 Pro 24H2 24H2 (64 bit)
- os/kernel: 10.0.26100.8655 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.26.4
- go/linking: static
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Microsoft Sharepoint

rclone copyto "D:\sharepoint backup\test.docx" "Planetcs:test.docx"

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[Planetcs]
type = onedrive
token = XXX
drive_id = XXX
drive_type = documentLibrary
[Shared]
type = onedrive
token = XXX
drive_id = XXX
drive_type = documentLibrary
### Double check the config for sensitive info before posting publicly
Paste config here

A log from the command that you were trying to run with the -vv flag

clone copyto "D:\sharepoint backup\test.xlsx" "Planetcs:test.xlsx" -vv
2026/06/13 16:51:46 ERROR : Attempt 1/3 failed with 1 errors and: corrupted on transfer: sizes differ src(Local file system at //?/D:/sharepoint backup) 8488 vs dst(OneDrive root '') 15508
2026/06/13 16:51:47 DEBUG : test.xlsx: Need to transfer - File not found at Destination
2026/06/13 16:51:47 DEBUG : test.xlsx: Starting multipart upload
2026/06/13 16:51:47 DEBUG : test.xlsx: Uploading segment 0/8488 size 8488
2026/06/13 16:51:48 DEBUG : test.xlsx: size = 8488 (Local file system at //?/D:/sharepoint backup)
2026/06/13 16:51:48 DEBUG : test.xlsx: size = 15511 (OneDrive root '')
2026/06/13 16:51:48 ERROR : test.xlsx: corrupted on transfer: sizes differ src(Local file system at //?/D:/sharepoint backup) 8488 vs dst(OneDrive root '') 15511
2026/06/13 16:51:48 INFO  : test.xlsx: Removing failed copy

welcome to the forum,

perhaps this is the issue?
https://rclone.org/onedrive/#unexpected-file-size-hash-differences-on-sharepoint

Many thanks for getting in touch, really appreciate that. That's all very useful information, I think the thing I find most odd is that it's all down to the filename extension, almost like graph is recognising an office document and mucking about with it. For example rclone copyto "D:\sharepoint backup\test.xlsx" "Planetcs:test.xlsx" fails but rclone copyto "D:\sharepoint backup\test.xlsx" "Planetcs:test.xls" works without error. Using --ignore-size --ignore-checksum does allow the copy to succeed but the files have been changed in the process which isn't good. Interestingly the .docx has to be a real Office file, If I create a .txt file and rename it to .docx the copy proceeds without error.

welcome


that is exactly the issue, thus the need for --ignore-size --ignore-checksum