Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In spring project, I am generating some pdf file automatically in my application and storing it in $CATALINA_BASE in tomcat server. The path is :


I have given one hyperlink on webpage to access this file. But when I click on that link it is giving error in Chrome console as below:

 Not allowed to load local resource:D:\Project_Local\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\happyweb\images\User.pdf

What is the problem and how so resolve that?

share|improve this question
up vote 2 down vote accepted

I have given one hyperlink on webpage to access this file.

When you provide the local path to a file in your webpages, as covered here, you're making the assumption that the file exists on the client's computer or device, not on your server.

Instead of using a local file path in your hyperlink like:


you should store the file in a directory that's served by your web server, and then use a URL to the file that includes your hostname, like:


If you do intend to serve a file locally (i.e., on the same computer), then you should use the file URI scheme. On Windows, that would look like:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.