Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing uploaded image

Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,

i uploaded an image using apache's class library at my localhost. now i want to access this image directly using method by passing the url of that image.

the image is located at the directry pointed by getServletContext.getRealPath() method(as i uploaded it using servlet). and in this case it is E:\java\UASProject\build\web\uploadedimage\image.jpg. the uri for a servlet located at E:\java\UASProject\build\web\web-inf\classes is http://localhost:8084/UASProject/storeimage. i tried to read image file using this url http://localhost:8084/UASProject/uploadedimage/image.jpg.

i dont know wheather i am doing right or wrong but this way is not working.

so please tell me what url should i use to acces a file when it is located at servlet context path?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic