Hi Marcel,
we had the same problem and solved it with a user macro. The
{filelink}
macro takes a filepath or directory copied from clipboard or entered manually & replaces the backslashes with forward slashes. A well known drive letter is replaced with an UNC path (In our case this makes files links compatible for VPN users who don't have the drive mapping).
As file link handling is so browser dependend, I doubt that there will be a solution directly from Atlassian...
## Macro title: filelink
## Macro has a body: N
## @param FilePath:title=Filepath|type=string|required=true|desc=A file (N:\Test\test.txt) or a directory (N:\Test). Driveletters and UNC-Path (\\Server\Share\Path\File.txt) are supported.
## @param Linktext:title=Linktext|type=string|required=false|desc=If left empty, filepath will be used
## Determine UserAgent via request)
#set($useragent = $req.getHeader("User-Agent"))
#if($useragent.contains("Edge"))
#set($browser = "ie")
#elseif($useragent.contains("Chrome"))
#set($browser = "chrome")
#elseif($useragent.contains("Firefox"))
#set($browser = "firefox")
#elseif($useragent.contains("MSIE"))
#set($browser = "ie")
#else
#set($browser = $useragent)
#end
## Replace drive N: with UNC path & backslash with forward slash
#set($url = $paramFilePath.replaceAll("\\\\/","/").replace("N:","))
## Set link text, if filepath. Debug handling
#if($paramLinktext)
#if($paramLinktext == '')
#set($linktext = $url)
#elseif($paramLinktext == 'debug')
#set($linktext = $useragent)
#else
#set($linktext = $paramLinktext)
#end
#else
#set($linktext = $url)
#end
#if(!$url.startsWith('/') && !$url.startsWith('\\'))
## Show remark, if drive is not N:
#set($tooltip = "The drive letter used might not be mapped for each user. Consider using an UNC-Path '\\SERVER\SHARE\...'")
#else
#set($tooltip = "This link might need the installation of certain browser addons and/or some special configuration.'")
#end
<a class="external-link link-tooltip" original-title="$tooltip" rel="nofollow" href="file:>$linktext</a>
## For debugging remove comment marks
##<p>$browser</p>
##<p>$useragent</p>
##<p>$url</p>
## Example User-Agent String:
## IE: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C)
## Edge: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
## Firefox: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
## Chrome: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36
Open filesystem links in browsers is a security related feature. It is possible with all three major browsers BUT you will need addons for Chrome & Firefox (For Chrome even an external helper process running). With IE you will need to add your domain to the trusted sites configuration.
Best regards,
Jan-Peter
In the meantime you might try using workarounds proposed in following KB/Community discussion.