设置<a href="“”"> when it&#39;s a local file

时间:2017-09-25 02:34:59

标签: html

<a href="file://{{files[i]}}">{{names[i]}}</a>

This is the one I am using for giving file path in my html template. files[i] is /Users/../../file1.txt and names[i] is file1.txt. In my webpage I am getting file1, file2 etc. And when I point my cursor to any of them, then the correct file path shows at the bottom. But when I try to click it is not redirecting to the file location. But when I copy the link address and paste it in a new tab, I am able to open the txt file. Can someone please give me a solution why this is happening.

0 个答案:

没有答案