This is a very basic html question, but I can't seem to locate the answer.
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:
<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?
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>
-
4why don't you just type: <a href="../June/foo.txt">Relative path Link</a>Arda– Arda2011年06月14日 11:36:51 +00:00Commented Jun 14, 2011 at 11:36
-
The problem with your file:/// is you do not include the hard drive path. example file:///C:/Users/Me/Desktop/Main/June/foo.txtTheDetailer– TheDetailer2016年05月12日 14:51:17 +00:00Commented May 12, 2016 at 14:51
2 Answers 2
Remove the file:/// part to have just ../June/foo.txt.
This should help you out.
Comments
If you simply drag your file from the solution explorer into the razor/html page, it will create for you everything you need.