Onedrive edit link downloads instead

What is the problem you are having with rclone?

I'm trying to create an "edit" share link for a Word file on OneDrive:

$ rclone link --onedrive-link-type edit Remote:folder/filename.docx
https://REDACTED-my.sharepoint.com/personal/MY_NAME_REDACTED/_layouts/15/download.aspx?share=CRYPTIC.STRING

But when I open this URL in a browser, I get the file offered for download, not for editing. That's consistent with the fact that the URL says download.aspx, same as the link created without --onedrive-link-type edit.

Is there any way to obtain a URL which in a browser opens Word (for a docx file) and lets me edit it? I tried to replace download.aspx by edit.aspx, doc.aspx, or open.aspx, with no success.

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

$ rclone version
rclone v1.69.1
- os/version: debian 12.10 (64 bit)
- os/kernel: 6.1.0-34-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.0
- go/linking: static
- go/tags: none

1.69.1 is the latest version, installed via sudo rclone selfupdate.

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

OneDrive Business

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

See above.

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

$ rclone config redacted
[Remote]
type = onedrive
token = XXX
drive_id = XXX
drive_type = business

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

2025/04/30 01:20:59 DEBUG : rclone: Version "v1.69.1" starting with parameters ["rclone" "link" "-vv" "--onedrive-link-type" "edit" "Remote:folder/filename.docx"]
2025/04/30 01:20:59 DEBUG : Creating backend with remote "Remote:folder/filename.docx"
2025/04/30 01:20:59 DEBUG : Using config file from "/home/ca/.config/rclone/rclone.conf"
2025/04/30 01:20:59 DEBUG : Remote: detected overridden config - adding "{03KeF}" suffix to name
2025/04/30 01:21:00 DEBUG : fs cache: renaming child cache item "Remote:folder/filename.docx" to be canonical for parent "Remote{03KeF}:folder/filename.docx"
https://REDACTED-my.sharepoint.com/personal/MY_NAME_REDACTED/_layouts/15/download.aspx?share=CRYPTIC.STRING
2025/04/30 01:21:00 DEBUG : 5 go routines active

The only special thing is that it says "detected overridden config - adding "{03KeF}" suffix to name" – I'm not sure what that means. The config file only contains what was written there by rclone config.

welcome to the forum,

that is from using --onedrive-link-type on the command line.


If you supply extra configuration to a backend by command line flag, environment variable or connection string then rclone will add a suffix based on the hash of the config to the name of the remote

1 Like

I've come up with a hacky workaround, which so far works for me.

It edits the link provided by Rclone. In bash / sed syntax:

original_link=$(rclone link --onedrive-link-type edit "$remote")
proper_link=$(echo $original_link | sed "s|/personal/|/${ind}/g/personal/|" | sed 's|/_layouts/15/download.aspx?share=|/|')

remote is the remote path to the file in Rclone format and ind is a file type indicator: :w: for Word, :p: for PowerPoint, and :x: for Excel.

So the id for edit-sharing created by Rclone is correct, but the overall URL structure is not. I'm not sure how much of the URL structure is installation / configuration dependent, especially /_layouts/15/.

The result corresponds to a manually created link, sharing with anyone for editing. I guess rclone link --unlink is advisable at some point.