title: Accessing local files on Tomcat
body: <p>I'm using Apache Tomcat 7 and I have a servlet where it lists all files in a directory and allows users to download the files by clicking on a link. </p>
  
  <p>Here is the problem:</p>
  
  <p>The files that I am accessing in the servlet are NOT in project directory itself. They are in a directory outside of the tomcat directory itself</p>
  
  <p>I.E.</p>
  
  <p>Project is in /opt/apache-tomcat-7.0.53
  Files are in /files/</p>
  
  <p>When I use an anchor tag, I can't reference using href="" because that assumes the directory is within the WebContent folder of the project. </p>
  
  <p>I tried doing <code>href="file:///files/&lt;FILE NAME&gt;</code> but I could not click on the link to download the file so something must be wrong.</p>
  
  <p>Anyone know how to work around this?</p>
  
  <p>EDIT: I should also point out this isn't running on my local machine. This is on a server.</p>