Question:
Relative Path help. I am writing a simple HTML site and need help.?
David P
2010-01-19 13:02:51 UTC
I am using HTML to link to a network drive. So here is a line of code that I am using to link to a certain folder on the Z: Drive.
East Folder 2
This works fine and I am able to link to that location no problem.
But I realized that not everyone here at the office has the network drive mapped the same way. Some people have Z some people have W.
I thought to use a relative path. Which I assume was like this.
ertain folder on the Z: Drive.
East Folder 2
But this doesn't seem to work. I assume I am doing something wrong, but can't find anything. I searched and found to use either a
/
or a double
//
but none seem to work.
Any help would be appreciated.
Six answers:
Michael from UK
2010-01-19 13:11:03 UTC
The file: directive is fine, but you need to find the 'real' name of the drive. As you say, different people can use different letters to map a network drive, so you must specify the real name.



Go to a command prompt and find the remote name the drive maps to (it is one of the 'net' commands - try 'net help' as a start); or look in Explorer - right-click the drive and the properties should give the full path name of the drive the letter is mapped to. Use that name rather than the Z: which is just a shortcut.



You can check it out by typing this name into explorer, and it should show your Z: drive.
2010-01-19 13:46:41 UTC
Your IT department can reset the drives' names so that all have the same name for the drive, but if it is a network drive, then all should be able to search and find the file no matter where it is with just the file name. If you are emailing HTML links to the network drive, it MUST be a common network drive so the entire directory structure is the same for all even if the drive letter is not. A relative path then will work without the drive letter.



Try replacing the drive letter with the IP address. Some browsers may have a problem with linking to a mapped drive. Try IE.



The main thing is that no web page "online" is going to access a computer's mapped drive unless you have the system set up as a server. I'm sure this must be what has been done since you mentioned making a web page for everyone to access. If there is an IP address for the network, then this shouls be used as part of the link.



Ron
2010-01-19 13:17:03 UTC
You really shouldn't be mapping HTML code to a file URL. The point of HTML is portability, and attaching any link to a file:// resource is going to break portability. Nobody on the Internet has access to your mapped drive (I hope) so the file won't work for any external viewers.



If you mean this to be an Intranet site (Internal to the business) I suppose you could make this work, but it's still not a great idea. Any files that are meant to be shared should be placed in a directory of the web server. It should really be placed under htdocs or public_html (depending on how your server is configured.) You could theoretically put a link to the mapped drive in this directory (on the server), but that has the potential of opening the entire networked drive to the Internet, which probably isn't what you want to do.



Just put a copy on the server. If you need, schedule regular updates so the file can be copied to the server when it changes.



One more thought:

It shouldn't matter how the users are mapped to the drive. What really matters is how the server sees it. Still, I think you should move the file directly to the server's file structure and run a relative reference from there...
Erika
2016-12-10 12:25:18 UTC
generally, once I make a template completed on something like Photoshop, that's barely a blueprint - something for a coder to create an rather HTML template out of. on your case, you are able to the two attempt that - or there is yet another determination. Use Dreamweaver. Open a sparkling HTML web site, create a table with one cellular, and insert the image interior. you are able to create "hotspots" utilising Dreamweaver to link it to different web site. in case you resize the website this additionally gets resized as those are anchored to the photograph. the concern with one in each of those sites is that those might take time to load (staring on the image length), and seek engines won't have the flexibility to index them - with the aid of fact they don't index content textile from photos. Your terrific guess right this is to recreate the template utilising Dreamweaver - you need to use a similar image, yet use div tags to show content textile, not directly on the image.
Jack
2010-01-19 13:50:48 UTC
Unless You save your directory that you wish to link to on the web and then use a normal "http://..."

statement to link to it i cant see a way of doing it
?
2010-01-19 13:13:53 UTC
Well, I personally don't have an answer, but I've seen a similar case to yours on www.MiNeeds.com where web designers answered it. I tried it twice and had a good experience. Hope it would help!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...