Linking to external files & folders ๐Ÿ”—

Linking to external files is mentioned in the drag and drop help documentation

Hold Ctrl on Windows/Linux or Option on macOS to create file:/// absolute links to those files instead of importing a copy.

but there arenโ€™t any examples of the options available. Iโ€™ll write up a request to add some examples to the official help documentation, but for the time being, hereโ€™s a list Iโ€™ve collected.


Windows

external link to file (Windows) โ†’
[link text](file:///C:\Users\USER\Desktop\file.txt)
[link text](file:///C:%5CUsers%5CUSER%5CDesktop%5Cfile.txt) ( %5C for \ )

In my testing on Windows, \ or / both work fine for local paths.
[link text](file:///C:/Users/USER/Desktop/file.txt)

Enclose paths that contain spaces in angle brackets (< >)
[link text](<file:///C:/Users/USER/Desktop/path with spaces.txt>)
or encode the space(s) with a %20
[link text](file:///C:/Users/USER/Desktop/path%20with%20spaces.txt)

external link to a folder (Windows) โ†’
[link text](file:///C:\Users\USER\Desktop\folder)
[link text](file:///C:%5CUsers%5CUSER%5CDesktop%5Cfolder)

[link text](file:///C:/Users/USER/Desktop/folder)

[link text](<file:///C:/Users/USER/Desktop/path with spaces>)
[link text](file:///C:/Users/USER/Desktop/path%20with%20spaces)

linking to a network share (Windows) โ†’
URL encode the \\ as %5C%5C before the share name/IP address, so โ†’

file โ†’
[link text](file:///%5C%5Cfileservername\path\to\file.docx)
[link text](file:///%5C%5Cfileservername/path/to/file.docx)
[link text](<file:///%5C%5Cfileservername/path/to/file with spaces.docx>)

directory / folder โ†’
[link text](file:///%5C%5Cfileservername\path\to\folder)


macOS

external link to file (macOS) โ†’
[link text](file:///Users/USER/Desktop/file.txt)
[link text](file:///Users%2FUSER%2FDesktop%2FCfile.txt) ( %2F for / )

Enclose paths that contain spaces in angle brackets (< >)
[link text](<file:///Users/USER/Desktop/path with spaces.txt>)
or encode the space(s) with a %20
[link text](file:///Users/USER/Desktop/path%20with%20spaces.txt)

external link to a folder (macOS) โ†’
[link text](file:///Users/USER/Desktop/folder)
[link text](file:///Users%2FUSER%2FDesktop%2Ffolder)

[link text](<file:///Users/USER/Desktop/path with spaces>)
[link text](file:///Users/USER/Desktop/path%20with%20spaces)

Linux

Should be similar to macOS above. I donโ€™t run Obsidian on any Linux devices at the moment to check.


related:

16 Likes

All of the above variations were tested and worked when I wrote the post, but backslashes may no longer work in the Windows links.

1 Like