Hi John, You may achieve this in two ways : 1. Place the file under your web context (WebApp) and then give the relative URL of the file in your web page 2. Place your file any where and stream the file content by reading the file byte by byte
On Thu, Mar 10, 2011 at 8:37 PM, John C <jac_legend_...@hotmail.com> wrote: > > 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 -- with best regards Ashish