Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Path Question for Linux versus Windows

Tom K

2003-07-21


I have a line of code that looks like this:

out.println("<br>ImageWWW = " + "<img src='" + serverPath2image +

         myUpload.getFiles().getFile(i).getFileName() + "' alt='Images'>");

 

It returns a string that looks like the one below, which works on Linux but not Windows

http:myIPAddress/upload/uploads/UniqueDateId/images/bird.gif

 

Of course if I change the forward slashes to a back slash it works on windows

http:myIPAddress\upload\uploads\UniqueDateId\images\bird.gif

 

How can I get the string to work on Linux and Windows browsers?

 

Thanks in advance!

 

T.K.

 

©2008 junlu.com - Jax Systems, LLC, U.S.A.