• Post Reply Bookmark Topic Watch Topic
  • New Topic

Attachment file not found error! Pls suggest  RSS feed

 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing the output of a query onto a text file and then sending the same file as mail attachment using a servlet.

The problem is that in both the case (while writing to the file and attaching) the program is not able to locate the file(while writing it is making the same file under the bin directory of tomcat).

Though the program works fine when i give absolute path.

Please suggest
 
Richard Bradford
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the HttpServletRequest.getRealPath(..) method.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!