rbollen
05-02-2003, 07:26 AM
Hi folks,
I'm working on a website. I get images from a database, but when there is no image available for that record, i wanna display a default error image.
So i have to check if the file exists, i do that with File.isFile()
but then i have to give the full path...
Can anyone help me??
here is the code:
String fotoString = "images\\shopping-cart-image.gif";
File foto = new File(fotoString);
System.out.println(foto.isFile());
if (! foto.isFile()){
fotoString = "images\\photo-not-available.gif";
}
Thanx
I'm working on a website. I get images from a database, but when there is no image available for that record, i wanna display a default error image.
So i have to check if the file exists, i do that with File.isFile()
but then i have to give the full path...
Can anyone help me??
here is the code:
String fotoString = "images\\shopping-cart-image.gif";
File foto = new File(fotoString);
System.out.println(foto.isFile());
if (! foto.isFile()){
fotoString = "images\\photo-not-available.gif";
}
Thanx