• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

architectural help required

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to develop an application who will serve as image sharing sort of tool. What i want is to upload all images of users in WEB-INF directory for security purpose, so that the images are not listed by users from URL. But on the same time, i want to display these images on a user specific page. How can i do this?

Second thing, I want to add a filter on images, so that I may track anyone (a website) which request of this image (request for image means user has uploaded image on my site and had given the image link on other site). So if an image is hosted in WEB-INF how can i add filter to it?

I want to do all this but i don't want to use any spring/struts/jsf thing. All i want to use is either Servlet or JSP.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would start by writing a servlet that can stream an image from under WEB-INF to a browser. Because this will give you a central point of control for all image retrievals, there will probably b no need for the filter.

You can grant/deny access and log any traffic right from there.
I have an an example app on my site with a servlet that streams images from under WEB-INF.
http://simple.souther.us
Look for SimpleStream.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
I would start by writing a servlet that can stream an image from under WEB-INF to a browser. Because this will give you a central point of control for all image retrievals, there will probably b no need for the filter.

You can grant/deny access and log any traffic right from there.
I have an an example app on my site with a servlet that streams images from under WEB-INF.
http://simple.souther.us
Look for SimpleStream.



Forgot....
That same project is also available for download from our CodeBarn
http://www.javaranch.com/codebarn
 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks. i'll look around for servlet stream. But i want to get the information (ip address etc)of the person who access that image, using my web applicatio url or given the link of that image on some other site
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a look at the methods on the request, you can find the client IP address. The http-referrer header (search google) should contain the url of the page where the image was loaded.
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic