Click to See Complete Forum and Search --> : link to local file on drive
Fire59
07-02-2004, 04:11 PM
I'm trying to create a link to a file on my hard drive.
on c:\ i have a file name test.txt
so i try
<p><a href="file:///C:/test.txt">test</a></p>
also tried
<p><a href="file:///C:\test.txt">test</a></p>
Can someone help ?
The first one should work, displays a text file.
Fire59
07-06-2004, 09:15 AM
I created a test file html file and put it on my desktop. Dragged that file into IE and click on the link and it work. I have a server running apache and on a page i have that same link to that file and it doesn't work.
Can anyone help?
patenaudemat
07-06-2004, 04:16 PM
Are you trying to access files on a user's hard drive? That doesn't seem too practical to me.
If the file is on your webserver, then of course C:\ won't work... you're either running UNIX or Linux, which uses a version of the ext filesystem. / is the root of the server, and, unless you own your server, your root would probably point to something like /home/(username)/htdocs. I'd use relative linking, personally. Eg, if your file is in the same directory <A HREF="test.txt"> or <A HREF="./test.txt">. For one directory above, <A HREF="../test.txt">; two above, <A HREF="../../test.txt"> and so on. If it's in your doc root, then <A HREF="/test.txt"> will suffice.
Did I even answer your question?
(Boy, I'm weird: I just edited my post because of a grammatical error)
Fire59
07-06-2004, 04:24 PM
Yes the situation may seem a bit odd. What's happening is i'm building a linux web server for a client. I'm also building an intranet site to go with this server.
They want to link several file on a network drive that everyone who login through novell have access to. SO i wanted to make a direct file link to those files.
SO it seem that if my server doesn't see a "J" or "K" drive then it wouldn't connect to it.
Thank you for all the help.
patenaudemat
07-06-2004, 04:30 PM
Oh... that's a good idea.
I don't know how much Novell software they have, but don't they provide an app launcher that integrates with a web server or something? Through ZENWorks, I think... but then again, I'm no expert!
Either way, there should be a way to do that. If it's an Intranet site, couldn't you host the site on the network drive, rather than a server? You don't get any of the cool server-side scripting stuff, but I've found that most of it can be remodeled in JavaScript.
Of course, that might not be what your client wants, so....