In case I did not explain myself well. I am trying to create a link to a file in a webpage. The link works fine using Apache + Tomcat if the file and link are both relative. This means that the html file containing the link to the text file is located in the same directory as the file itself. However I would like to link to absolute files anywhere on the system where the Apache + Tomcat server is hosted. In this case I am running on local host and using the absolute link to the file (file:///C:/Users/OEM/Desktop/testa.txt). Unfortunately this doesn't work. Any idea what I am doing wrong?
> From: [email protected] > To: [email protected] > Subject: Cannot create a link to a file - suspecting tomcat is the issue > Date: Fri, 11 Mar 2011 04:07:47 +1300 > > > I am trying to create a link to a file in my webpage. The anchors href for > the link is "file:///C:/Users/OEM/Desktop/testa.txt". When I run my webpage > from file I can click the link > (file:///C:/Users/OEM/Documents/NetBeansProjects/WebApp/web/main.htm). > However when I run my webpage using Apache Server and Tomcat I cannot click > the link (http://localhost:8080/WebApp/main.htm). What I am trying to achieve > is to be able to create a link to a file located anywhere on the server. > Since I am using localhost, I would like to point to this file > (file:///C:/Users/OEM/Desktop/testa.txt). How do I do this? Does the file > have to be relative to Apache Server? > Thanks
