This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Saving image on server. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Saving image on server." Watch "Saving image on server." New topic
Author

Saving image on server.

Ratan Pawar
Ranch Hand

Joined: Jan 18, 2008
Posts: 33
i am saving image on server.
when i run it on one m/c as client and server is same its working.
for this saving image as file in temp folder i use path as c://workplace/stud_app/jsp/temp/Filename in servlet.
but application run on cvs as server is different i could not save image.
i tried as request.grtContextPath+temp/Filename its not working.
how i get this server path to save file.
i use Eclipse to run application.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What is "m/c"?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ratan Pawar
Ranch Hand

Joined: Jan 18, 2008
Posts: 33
client and server is on same computer.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35253
    
    7
its not working

What does this mean? What exactly is the code doing, and how is or isn't it behaving according to your expectations? Are there any error messages?
[ February 18, 2008: Message edited by: Ulf Dittmer ]

Android appsImageJ pluginsJava web charts
Arivazhagan Arutchelvam
Greenhorn

Joined: Feb 19, 2008
Posts: 10
You should not hardcode the file path in the servlet. If you hardcoded it, then there must be a folder structure matching your file path, must be present in the server machine.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What is "m/c"?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Saving image on server.
 
Similar Threads
servlet API
Problem in copying file from server to client local machine folder
how to save the file in clint side in temp folder
context root
How to read xlsx file from local java file