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

UPDATE: from Obsidian v1.5.11 on, use forward slashes in paths
UPDATE2: Not sure when it happened, but backslashes are working for me linking to local files again on Windows (using Obsidian v1.8.6). e.g. ![](file:///C:\Users\USER\Desktop\1.jpg). Regardless, using the Ctrl/Optn + drag and drop is still the safest here.

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)
[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:

24 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

I’m on Gnome 46 and Ctrl-Dragging a file from Nautilus (“Files”) to create a link doesn’t work.
more specifially:

  • Dragging copies the file into the vault
  • Ctrl-Drag-Release (hold Ctrl, drag file, drop file) does nothing
  • Drag-Ctrl-Release (drag file, hold Ctrl, drop file) does nothing

For the Nautilus fork Nemo:

  • Dragging copies the file into the vault
  • Ctrl-Drag-Release copies the file into the vault
  • Drag-Ctrl-Release creates the text file:///home/username/file.txt (which is rendered as a link)

So neither currently seem to actually create links.

Hi, I’m on Obsidian mobile for Android. 1.8.9.

I’ve tried various notations to link to outside files. Yet without any luck. Using the MacOS as guidance, as it is Unix, and Android also.
Somebody else tried and succeeded?

My use case to have outside files is:
I like to have my database/vault to be small in size for bytes size. I have some jpg, pdf and txt attachments, but quite small. Vault=≈4,5MB for 154 files and 65 dir’s.
Of which 1,9MB for 2 themes and 9 plugins and 2 zipped plugins for backup. 0 snippets, .trash is empty.

Best regards.
GJ.

Edit 01: I did found the following: it seems quite hard to do it on mobile OS’s: Cross-platform links to external files - #4 by holroy