Confluence: How to place a link to a file on a server share in a confluence page?
Asked by Eric Blair:

Hi,

I'd like to have a link like this on a Confluence page: \\\\\<server\>\\\<$share\>\\installer.msi

I tried placing it in as is, and doesn't work. Also tried file:///\\\\\<server\>\\\<$share\>\\installer.msi but that doesn't work either.

Any ideas?


Answers:
author: Bernabe Theodore Costales III
body: Hello folks!

I see that this thread has had a lot of attention over the years and I'd like to summarize the answers that have been presented thus far, since there are worthwhile observations that people have made.

First: in the case of [@Eric Blair](/t5/user/viewprofilepage/user-id/871441), there is no specific way to accomplish this in 100% of browsers without using some type of intermediary routing service. As you can see in the answer with the most votes, some browsers support opening file paths in this fashion: \[[jump link](https://community.atlassian.com/t5/Confluence-questions/Re-Confluence-How-to-place-a-link-to-a-file-on-a-server-share-in/qaq-p/258798/comment-id/43693#M43693 "Atlassian Community")\]

However, it does not work as a full solution. Setting a CNAME record like [@Laurent Corbi?re](/t5/user/viewprofilepage/user-id/502266) had suggested might work for your needs: \[[jump link](https://community.atlassian.com/t5/Confluence-questions/Re-Confluence-How-to-place-a-link-to-a-file-on-a-server-share-in/qaq-p/258797/comment-id/43692#M43692 "Atlassian Community")\]

There are also alternate solutions such as what was presented by [@Thomas Peter Berntsen](/t5/user/viewprofilepage/user-id/664659) where you can use an addon from the Atlassian Marketplace: \[[jump link](https://community.atlassian.com/t5/Confluence-questions/Re-Confluence-How-to-place-a-link-to-a-file-on-a-server-share-in/qaq-p/258800/comment-id/43695#M43695 "Atlassian Community")\]

At the end of the day, it depends on your browser environment. [@David Skreiner2](/t5/user/viewprofilepage/user-id/853321) posted a knowledge base article that explores this in brief as well: \[[Knowledge Base link](https://confluence.atlassian.com/confkb/cannot-link-to-local-files-from-within-confluence-216958257.html?_ga=2.23173434.1497626423.1504108508-1951479142.1499955342 "Atlassian Community")\]

Thanks everybody for their participation in this question!

comments: author: Marek Sokal
body: Hello everyone.   

I was curious if anyone else has some ideas on how to approach this. I have a lot of data that occasionally gets updated that live on Network Shares.

My current favorites are:

For IE users, I found adding an HTML macro and using an iframe works, although you need to accept a security warning when accessing the page, it works really nice though!

```
<iframe src="file://///server/share" noborder="0" width="1000" height="450" scrolling="yes" seamless></iframe>
```

<br />

For Chrome, I have installed the Enable Local File Links extension, and it works great, however I really wish that it enabled you to use iframes, or something similar to display an index, similar to how Chrome displays it.


author: Jim Ryan
body: This has ++**nothing**++ to do with browsers and all about Confluence. I can put file://server/folder name into my browser and hit enter and a windows explorer window opens with my files. I put any combination of all of the above in Confluence (why do I keep wanting to type confustion?) and it doesn't work. In fact the string I use to put the link behind doesn't even show up as a link. I'm using 5.7.3 of this POS. What is amusing is all the claims of it working above have different solutions. None of which work for me.

I thought I had it by creating the link in OneNote and copying it into my confluence page. It at least showed up as a link while editing, but as soon as I saved it the link was gone..

comments: author: Daniel Williams
body: This is about browsers -- you can type the file:// address into the address bar, but most browsers block such addresses as links from non-local sources, as it's a security issue: consider a link like file://downloads/bad-file-i-just-made-you-download


author: lukec
body: Agreed.. this works for me in IE but not Chrome


author: Andrey
body: Using Confluence 5.5.2, the following syntax worked for me on Chrome, FF, and IE:

```
file:///server/share/etc
```

The path to which I was trying to link contained spaces, so I had to place this in brackets:

```
[file:///server/share/etc/some path/with spaces]
```

comments: author: Andrey
body: Just to add, make sure you use forwards slashes (/) and not the backwards slashes (\\) that Windows likes so much or the links won't work


author: min.tech
body: our confluence page just decided to add "/" in front of the address, so it became  
"/\[file://......"  
and it does not work with below error:
> java.lang.IllegalArgumentException: [java.net](http://java.net/).URISyntaxException: Illegal character in path at index 1: /\[file:/.......


author: Klara Zikesova
body: have the same problem as min.tech, just the string our Confluence added is even much longer, it starts with https and and our Confluence address and ends the same as his, so it does not work either :-(


author: David Skreiner
body: <https://confluence.atlassian.com/confkb/cannot-link-to-local-files-from-within-confluence-216958257.html>


author: Thomas Peter Berntsen
body: Hi Eric,

The "Infinidex" plugin which we've developed for searching and linking files on network shares within Confluence helps with exactly this (and automatically works around some of the browser quirks wrt linking to files).

Check it out on: <https://marketplace.atlassian.com/plugins/dk.translucent.atlassian.confluence.infinidex>

Best,  
Thomas (Translucent - developers of Infinidex)


author: Laurent Corbi?re
body: Hi Eric,

Indeed, this is a security browser issue.

The workaround I'm using is to get an https url for your folder. I don't know exactly how to do it because it's our network dept who's in charge of it.

It's call a cname and it works perfectly if the folder is in public share.

<http://en.wikipedia.org/wiki/CNAME_record>

So your

file://folder/installer/installer.msi

will become

<http://publicfolder/installer.msi>

Have a nice day,

Laurent


author: Henning K?hler
body: We always use this format for opening network folders or files from IE9:

```
file://SERVERNAME/PATH/FILENAME
```

Do NOT use a drive letter like C: but the Servername.

And make sure you use / (SHIFT+7) instead of \\

In IE9, links to external network drives and files only work if you add the URL of your WIKI to the "Trusted Sites" in the IE9 Internet Security Settings of the Browser.

comments: author: Kevin Mote
body: This is the format that finally worked for me.

Type the following into the editor

`[`file`:`//SERVERNAME/PATH/FILENAME WITH SPACES]

(the brackets disappear, and the resulting link opens a "Open/Save/SaveAs" dialog box)


author: James Mark Chan
body: What browser were you using?


author: Sven
body: if you use NoScript you have a bigger problem, but there is a workaround:

- enable it in noscript settings (open local links-checkbox)

and add (only for this case) the following entries:

```
user_pref("noscript.policynames", "localfilelinks");	user_pref("capability.policy.maonoscript.checkloaduri.enabled", "allAccess"); 
```

Now file:///-Links work on sites when they are in NoScript-Trusted-Sites...

If you want to go one step further (and open file:/// links not only inside of FireFox, but in Windows Explorer), you have to set the following settings (additionally)

```
	user_pref("network.protocol-handler.expose.file",false);	user_pref("network.protocol-handler.external.file",true);  
```

First time you click on a file:///-Link you will get a prompt from FireFox to select the program with which you want to open them -\> choose "C:\\Windows\\Explorer.exe" and don't forget to check the "remember"-checkbox.

From that time they will open directly in Windows Explorer - very useful ;-)

Hint: NoScript overwrites this setting again on each FF-startup. So my only workaround was to write a small FF-Plugin who overwrites them again ;-)


author: Michael Roff
body: I don't think this type of link works in Firefox due to security restrictions. There are a few other write ups on this if you google it.

IE does work though from my past experience. In Confluence though, I don't think you have to be that specific with the syntax, you should be able to put in the server address and the link should just work. I overthought this some time ago only to find out that you don't have to be that tricky.


author: Bob Swift (personal)
body: Try file://///server/.... and check on both IE, Firefox, ... . It is a pain getting something that works for multiple browsers.

comments: author: dvillacorte
body: The 5 forward slashes works like magic for us!


author: Curry Kinyon
body: Using

file://///servername.com/folder/folder/folder with spaces

Solved our issue, no extra brackets or quotes were needed to manage the spaces when inserting it as an advanced link in Confluence 6.12.4

comments: author: Magnus Wiethoff
body: Does also not work for me.


author: Arlene Butwell
body: Any updates on this thread? I need to be able to link to a shared drive. I have tried all the suggestions above with no joy :(

comments: author: Patrick_Vanhoof
body: Our advice is to, if possible, put the documents in our DMS and link to there. Advantage: the link keeps working, even if the file is moved or renamed. Any small change to a document on the file server will break the link.


author: Grace San Juan
body: I have Confluence 6.0.2. Can you please tell me how I can open an HTML file that is saved on a network drive?

The address is: \\\\servername\\folder 1\\folder 2\\file.html

Note: the folder names have spaces.

I tried the suggestions posted above but none of them work. I can add a link to the file but the file cannot be previewed or opened. Any idea why? Can you please help?

Thanks in advance!

comments: author: Bernabe Theodore Costales III
body: [@Grace San Juan](/t5/user/viewprofilepage/user-id/1139510) There are few other threads which talk specifically about network file access, but in general the same rules apply: due to most modern browser security policies, opening a network space from a URI is generally restricted. You'll want to consider hosting the HTML file through an intermediary web server - or, if the point of the network link is to provide the code to users, consider posting the code in a restricted form.

If you need any further assistance with this, please open up a new thread and the community team will be happy to help! Here are some additional threads for you to explore (with similar answers as discussed in this thread, though): \[[Community jump link](https://community.atlassian.com/t5/Confluence-questions/How-can-I-link-to-folders-on-company-shared-drive/qaq-p/83856 "Atlassian Community")\]


author: Jim Ryan
body: This has ++**nothing**++ to do with browsers and all about Confluence. I can put file://server/folder name into my browser and hit enter and a windows explorer window opens with my files. I put any combination of all of the above in Confluence (why do I keep wanting to type confustion?) and it doesn't work. In fact the string I use to put the link behind doesn't even show up as a link. I'm using 5.7.3.. What is amusing is all the claims of it working above have different solutions. None of which work for me.

I thought I had it by creating the link in OneNote and copying it into my confluence page. It at least showed up as a link while editing, but as soon as I saved it the link was gone..


author: Jonathan Schreven
body: I'm having the same issue. The address is:

\\\\servername\\folder1\\folder2

I can put this in the browser (Chrome Version 69.0.3497.100 (Official Build) (64-bit)) in the following format:

file:///servername/folder1/folder2

and it opens an index page in Chrome instantly where I am able to navigate the file structure and download files. No issues.

I copy and paste that exact address into Confluence as a Weblink and then, still in edit mode, click on the link and hit "Go to Link" and a new tab opens but it is blank. When the page is published, it doesn't even recognize there is a link there anymore. Can't click on it. Switching back to edit mode, Confluence does not recognize it as a link and it has to be added again (and the cycle repeats).

I've tried all the variations above with file:///// and file:/// and file:// and putting \[\]'s around it. Since it works flawlessly in the browser and breaks down only when I try using it as a link in Confluence, it sure seems like the breakdown is in Confluence. Maybe I'm missing something, but this would be really helpful to have fixed. Let me know if I can provide more info to help.


author: Alex Fuller
body: I'm sorry - I'm kind of new, but could you please explain where this should go. I want to be able to open a HTML site that is saved on my server (S drive).

The address is: file:///S:/SUPPLY%20CHAIN/Dashboard/dashboard.html but I can't seem to get it to link to it no matter what I try.


author: Jordan Hauser
body: Hi community,  

I stumbled across this thread while trying to find an answer for this question myself and figured I would share how I solved it  

Confluence really didn't like trying to access a network drive, so I decided to try the links for files in sharepoint/teams and was successful  

I recommend using the 'insert link' macro with the 'web link' option selected, going to the location of the file in sharepoint/teams and just doing a right click, then 'copy link' to put it into the address field  

Regards,  
Jordan


author: Younes Ouchtouban
body: hi,

if you have a spear VM, you can mount your share there, set up an web filebrowser for it (apache for exemple, easy to code )

then you can put normal url where you need in your confluence page


author: Roman Tymoshenko
body: [TMCLI-1549](https://teratera.atlassian.net/browse/TMCLI-1549 "TMCLI-1549")


author: Robert Ortner
body: just a short hint - as it is always a hassle using the file links like file://server.domain/name/... or file:////server and so an a good approach is to setup an ftp server with anonymous read only permissions and linke to the fileshare iusing <ftp://server.domain/>.... and so on. **For internal use** this is an easy approach and works fine with all browsers and no need to change security settings.


author: Ivan
body: Hi [@Bernabe Theodore Costales III](/t5/user/viewprofilepage/user-id/1140631) / [@AnnWorley](/t5/user/viewprofilepage/user-id/502040),  

I cannot seem to make this work in Chrome Version 66.0.3359.181 (Official Build) (32-bit).  

Works in IE Version 11 on the same machine.

* [Atlassian Confluence](http://www.atlassian.com/software/confluence) 6.9.1

Any ideas? Is this to do with Chrome?  

comments: author: Bernabe Theodore Costales III
body: Based on your brief description this does sound like a browser-side rendering issue. Per the original analysis and summary it really comes down to "how a browser interprets URIs meant to point to local-side resources", so if it works as expected in another browser but not with Chrome 66, then it is likely Chrome's rendering engine is probably "cleaning" the links in some way.


author: Madhusudhan Matrubai
body: Hey [@Bernabe Theodore Costales III](/t5/user/viewprofilepage/user-id/1140631) , we are having the same issues and has taken away one of the Confluence functionality to link files on network location. Since Chrome is supported browser isn't there should be a fix/patch to handle that.  

Would appreciate if there are any workarounds.

Thanks,  
Madhu


author: AnnWorley
body: Some customers have found the workaround on this ticket to be helpful:

[Expand external links security filtering to allow digits, plus, hyphen and periods in protocol](https://jira.atlassian.com/browse/CONFSERVER-28103)


author: Mani Koodalingam
body: This one works with Confluence 5.5.2 with IE 9

\[\\\\servername\\share\] - to link network share folder

\[\\\\servername\\share\\file.txt\] - to link network link

catch is you need get the conflunce to contruct the link so

type \[ first

then copy paste the whole link and then type \]


author: John Lin
body: It works with firefox. See the

<https://developer.mozilla.org/En/A_Brief_Guide_to_Mozilla_Preferences#modifying>

and

[http://kb.mozillazine.org/Links_to_local_pages_don%27t_work#Using_an_Extension](http://kb.mozillazine.org/Links_to_local_pages_don%2527t_work#Using_an_Extension)

the gist of it is to create a user.js with the following content

```
user_pref("capability.policy.policynames", "localfilelinks");user_pref("capability.policy.localfilelinks.sites", "http://servername:prot");user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
```


Tags: file

link