Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in saving a file in the relative path which is uploaded at remote place  RSS feed

 
bhagya raavi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir,
i written the code for uploding a file.after uploding it i read the content of file and written to a file.i want to save that file in the webserver folder where the tomcat is running.i uploaded the file in the remote place.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This forum is for questions about JavaRanch itself. I'll move the thread to a more technical forum for you.
 
Michael Raymond Jr.
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bhagya raavi:
sir,
i written the code for uploding a file.after uploding it i read the content of file and written to a file.i want to save that file in the webserver folder where the tomcat is running.i uploaded the file in the remote place.


I've not used java/tomcat environment in months, but I think there are two things to try here:
- add the relative path of the file to the http://webservername/ to make the file path (eg http://localhost:8080/mywebsite/mysitesFiles/fileName.xyz)
- or, make sure where you are saving the file is in the same folder, or subfolder, where you are running your web application from. I don't think tomcat - or probably any decent container for that matter - will allow you to save in the container's context if it is outside of the currently running web application's folder. For instance, you probably can't save in c:\tomcat\someFolder if you are running your site out of c:\tomcat\mywebsite
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!