帮助相对路径链接到本地文件
This is a very basic html question, but I can't seem to locate the answer.
这是一个非常基本的HTML问题,但我似乎找不到答案。
I have a local file located here:
我在这里有一个本地文件:
/Users/Me/Desktop/Main/June/foo.txt
In an .html document located within the /Main directory, I can link to the foo.txt
file using the full path:
在位于/ Main目录中的.html文档中,我可以使用完整路径链接到foo.txt文件:
<a href="file:///Users/Me/Desktop/Main/June/foo.txt">Full Path Link</a>
I would like to use relative paths to link to foo.txt
. Does anyone know how to create a relative path link to this foo.txt
file?
我想使用相对路径链接到foo.txt。有谁知道如何创建这个foo.txt文件的相对路径链接?
I tried the code below and a number of similar permutations, but I can't seem to successfully write the relative path link for this local file.
我尝试了下面的代码和一些类似的排列,但我似乎无法成功写入此本地文件的相对路径链接。
<a href="file:///../June/foo.txt">Relative path Link</a>
Thanks in advance. Any help is appreciated.
提前致谢。任何帮助表示赞赏。
2 个解决方案
#1
28
Remove the file:///
part to have just ../June/foo.txt
.
删除文件:///部分只有../June/foo.txt。
This should help you out.
这应该可以帮到你。
更多相关文章
- 在页面重新加载时添加活动链接和jquery幻灯片切换到自定义ajax w
- 如何将这些Twitter bootstrap 3导航栏链接集中在一起?
- PHP的目录路径问题
- thinkphp友情链接代码
- php 获取当前页面url路径
- wordpress永久链接重新加载页面,而不是重定向到发布
- 解决PHP导出大量数据时设置超链接的问题
- 如何使用Amazon S3创建一次性下载链接?
- PHP 站点相对包含,路径的问题解决方法(include,require)