In a Markdown Page (Microsoft TFS Wiki)
I try crate A tag for file
link:
<a href="file:///C:/temp\file.txt">file.txt</a>
On click (Chrome), I got
about:blank#blocked
In a Markdown Page (Microsoft TFS Wiki)
I try crate A tag for file
link:
<a href="file:///C:/temp\file.txt">file.txt</a>
On click (Chrome), I got
about:blank#blocked
It's not a Chrome-specific issue with protocol file:, Opera and Firefox display blank page too.
When I want to browse HTML files on my localhost, I have to access them via protocol http: instead.
For instance when I want to see C:\temp\file.html
in Chrome, I will make a virtual directory in my local Apache host:
<VirtualHost *:80>
DocumentRoot C:/temp
ServerName temp.localhost
</VirtualHost>
and add this line to %SystemRoot%\System32\drivers\etc\hosts
127.0.0.1 temp.localhost
Now I can see the file in browsers at URL http://temp.localhost/file.html
I encountered this when I a place I worked at used a web app that referred to files in shared folders on network drives. For a while now, browsers haven't allowed web sites to access local file systems. If you specify a path to a local file, the browser won't let you use that path. It substitutes something else. It's for security. I don't know of a work around, sorry.
I had the same problem happening for linked-to XML files (*.xml) rather than markdown files. It was happening both with links to XML files on my own computer, and to XML files on an intranet server.
To avoid the page being blocked for URLs like that, what works for me is instead of clicking the link or right-clicking it and selecting to open it in a new tab (neither of which works), is to right-click the link and copy it, then paste it into the URL bar of a new tab. Then the browser displays the file okay.
© 2022 - 2025 — McMap. All rights reserved.
download
to the<a>
– Purtenancehref
is correct? addtarget="_self"
and try again – Purtenance