• 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

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

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic