Confluence: How to place a link to a file on a server share in a confluence page?

Eric Blair November 15, 2011

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?

21 answers

1 accepted

20 votes
Answer accepted
Bernabe Theodore Costales III
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2017

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, 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]

However, it does not work as a full solution. Setting a CNAME record like @Laurent Corbière had suggested might work for your needs: [jump link]

There are also alternate solutions such as what was presented by @Thomas Peter Berntsen where you can use an addon from the Atlassian Marketplace: [jump link]

At the end of the day, it depends on your browser environment. @David Skreiner2 posted a knowledge base article that explores this in brief as well: [Knowledge Base link]

Thanks everybody for their participation in this question!

Marek Sokal February 4, 2019

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>


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. 

Like # people like this
9 votes
Jim Ryan August 30, 2017

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..

Daniel Williams November 19, 2018

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

Like # people like this
lukec July 9, 2020

Agreed.. this works for me in IE but not Chrome

Like Antonio Goicouria likes this
6 votes
Deleted user June 12, 2014

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]

Andrey April 28, 2015

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

Like lukec likes this
min.tech August 30, 2016

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.URISyntaxException: Illegal character in path at index 1: /[file:/.......

Like Klara Zikesova likes this
Klara Zikesova March 16, 2023

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 :-(

2 votes
David Skreiner
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2016
2 votes
Thomas Peter Berntsen March 8, 2015

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)

2 votes
Laurent Corbière January 10, 2013

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

2 votes
Henning Köhler January 6, 2013

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.

Kevin Mote
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2016

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)

James Mark Chan August 25, 2017

What browser were you using?

2 votes
Sven
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2012

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 ;-)

2 votes
Michael Roff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2011

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.

2 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2011

Try file://///server/.... and check on both IE, Firefox, ... . It is a pain getting something that works for multiple browsers.

dvillacorte April 21, 2016

The 5 forward slashes works like magic for us!

Like Nicholas Little likes this
1 vote
Arlene Butwell November 18, 2019

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 :( 

Patrick_Vanhoof
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2019

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.

1 vote
Grace San Juan July 5, 2017

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!

Bernabe Theodore Costales III
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2017

@Grace San Juan 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]

Jim Ryan August 30, 2017

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..

Like Tanner Sullie likes this
Jonathan Schreven October 17, 2018

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.

1 vote
Alex Fuller June 27, 2012

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.

0 votes
Younes Ouchtouban January 18, 2021

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

0 votes
Curry Kinyon January 15, 2020

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

Magnus Wiethoff February 24, 2020

Does also not work for me.

0 votes
Roman Tymoshenko October 14, 2019
0 votes
Robert Ortner October 17, 2018

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. 

0 votes
Ivan June 7, 2018

Hi @Bernabe Theodore Costales III / @AnnWorley,

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.

Any ideas? Is this to do with Chrome?

Bernabe Theodore Costales III
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 2018

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.

Madhusudhan Matrubai June 12, 2018

Hey @Bernabe Theodore Costales III , 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

0 votes
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2017

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

0 votes
Mani Koodalingam August 5, 2014

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 ]

0 votes
John Lin December 5, 2011

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

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");

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events