3

Im trying to set-up an alternate docroot in order to serve uploaded documents from. I have included the following in my glassfish web xml

<context-root>/dom</context-root>
  <property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:/Test" /> 

I have then stored a test pdf in the Test folder called cars.pdf.

To access it i am typing the following into my browser

http://localhost:8080/uploads/cars.pdf

This however simply gives me a 404 error, ive tried googling and searching about here but nothing seems to work. Can some tell me what im doing wrong?

Thanks Steve

user3629870
  • 43
  • 1
  • 5

1 Answers1

6

You should use

<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:\Test\" />

and then drop your images into C:\Test\uploads\

or, for example, use

<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:\" />

and then drop your images into C:\uploads\

Steve Westbrook
  • 1,698
  • 2
  • 20
  • 21
Javier Haro
  • 1,255
  • 9
  • 14
  • Hi thanks for your reply, the docs at oracle don't explain well what you have put up there thanks for the answer i finally have it working – user3629870 May 14 '14 at 21:33