Saving image on localhost
843841May 12 2005 — edited May 13 2005Hi,
I am attempting to save an image which I have created in a servlet on my localhost using the following code snippet
File f = new File("http:\\localhost:8080\\midp\\map.jpg");
ImageIO.write(bi, "jpg", f);
Where midp is a folder in my webapps folder containing my java files etc.
This generates a FileNotFoundException
The following code works fine and saves the image to the jakarta bin folder.
ImageIO.write(bi, "jpg", new File("map.jpg"));
Can anyone shed any light on what the correct file url should be?
Thanks