Getting Absolute path

how to manipulate or to change the folowing absoulute pathto worrk in web browserString p = C:\Program Files\Tomcat\webapps\myApp\tempData\regards
[174 byte] By [the_Orienta] at [2007-11-27 0:27:42]
# 1
hi try using String p = C:\PROGRA~1\tomcat\webapp\myApp\tempDirI think this will solve your problemRegards,-- Abdel Olakara http://olakara.googlepages.com
Olakaraa at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

works not

but the main problem I wanto to change the retrived absolute path

the my files on the server my web hoster

in back end I becom the the path of the context

String p=request.getSession().getServletContext().getRealPath("/")+"tempData"+java.io.File.separator;

I want to use the path in javascript

how to maniputate tha path to use it in javascript

thanks

the_Orienta at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
any help
the_Orienta at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
wenn I use relative path it works fine local on my home pc but it works not by my web hoster therefor I will use absolute pathplease I need urgent help thanks
the_Orienta at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Java runs on the server.

Any file I/O you do in java happens on the server.

You can not write files to the client computer in code. To do so would be a security hole.

The best you can do is send the file to the person, and prompt them to save it. They then choose where they want to save it.

evnafetsa at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

the problem isnot so as you did understand

Problem description

I have web application clients users upload images I read the images from the request Object and I save it in a folder "tempData" in the web application

myApp/ tempData

after upload user will see their uploaded images to check

I try to display the uploaded images in browser using relative path

notice local on my home pc works fine

but by my web hoster images can not be displayed an I am sure it is a path problem

meine question how can I use the absoulute path in javascript to find

the uploaded images

thanks

the_Orienta at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
any help
the_Orienta at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

The image is saved on the server in the

/myApp/tempData folder?

So you would request it to the client browser with the url:

http://www.myServer.com/myApp/tempData/imageName.jpg

specifying a url of "c:\tomcat..." tells the browser to look for the image on your local machine - NOT on the server. Which is probably why it works on your home pc, as your server and client are the same machine.

evnafetsa at 2007-7-11 22:27:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...