0

I have created a Webapp that requires external images. I achieved that by creating a shortcut of the extFolder in the eclipse project folder (WebContent/Web/images/extFolder).

Now when a user tries to upload a new picture, after the upload the old picture is shown and new one won't show until I restart the webapp.

a. Is there a better way to add an external folder in Tomcat 8

b. If no then can the Webapp refresh that directory to incorporate the changes?

  • 4
    http://stackoverflow.com/questions/417658/how-to-config-tomcat-to-serve-images-from-an-external-folder-outside-webapps – stacktome Apr 22 '16 at 06:53
  • All these solutions a. didnt work b. are not desirable to change the .xml file of the sever – Gaurav Sharma Apr 22 '16 at 11:16
  • They actually do work and a download servlet (the accepted solution in that question) *is* best practice. In fact, it's not desirable to go with the configuration that you're currently describing. It will create a maintenance nightmare and possibly open you up for attacks (if someone uploads jsp files to that external folder, for example) – Olaf Kock Apr 24 '16 at 08:50
  • I made a servlet that copies the image into an external folder on submit but when I want to show the profile of the user, the servlet I use to copy that file into my tomcat web app fails, because for some reason my pwd(Present working Directory) is /home/user-name/Desktop/ – Gaurav Sharma Apr 24 '16 at 16:05

0 Answers0