Funny you should mention that, i've just tried this.. Still no joy.
String strPicUrl = "../images/07News/news" + id + "image1Thumb.jpg'";
File theFile = new File(application.getRealPath(strPicUrl));
out.print("File Exists: " + theFile.exists() + "<br>");
The file is in my...
I am writing a web page, where I would like to check if an image exists on the server or not. ie..
if(imageExists(image1.gif))
{
<img src='image1.gif'/>
}
else
{
//Do nothing
}
Something like above.
I've tried...
File file1 = new file(image1.gif);
if(file1.exists()) do this;
but...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.