Two Laptop Bag*
The moose likes Servlets and the fly likes Saving image on server. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
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: 41133
    
  45
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 ]

Ping & DNS - my free Android networking tools app
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"?
 
 
subject: Saving image on server.
 
Similar Threads
how to save the file in clint side in temp folder
How to read xlsx file from local java file
servlet API
context root
Problem in copying file from server to client local machine folder