about:blank#blocked on <a href="file:///XXX">Link</a> (Markdown Page)
Asked Answered
K

3

11

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

enter image description here

Koenig answered 11/3, 2019 at 11:46 Comment(6)
Add an atribute download to the <a>Purtenance
@Roy still not workingKoenig
Are you sure that the href is correct? add target="_self" and try againPurtenance
@Roy still.....Koenig
I can't help if you don't make a working demo... sorry mate, i need more references to discover the problemPurtenance
Does this answer your question? How to specify a local file within html using the file: scheme?Foramen
S
1

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

Sconce answered 3/8, 2019 at 15:1 Comment(0)
H
0

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.

Heffernan answered 19/4, 2024 at 17:44 Comment(0)
H
0

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.

Harriet answered 31/7, 2024 at 2:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.