• Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading Image From JSP Page

 
Rajat Raina
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to upload an image from jsp page. I can save it to any drive of my system but i am not able to store it inside my project directory structure. I am using struts.
Please help.......
In new file i want the path of my project folder not c drive.
Code is
 
Ankit Garg
Sheriff
Posts: 9591
34
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the other path that you tried. If you try a normal relative path, then I think it will be relative to the classes directory in the web-inf directory and I don't think servlets have the permission to modify the web-inf directory due to security reasons. Try using servletContext.getRealpath("relative path") and then see if it works...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!