Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. croyce

    JSP - Checking if a file exists.

    ServletContext app = getServletContext(); String path1 = app.getRealPath("images/07News/news" + id + "image1Thumb.jpg"); File theImage1 = new File(path1); String imageURL1 = "/images/noImage.gif"; if(theImage1.exists()) { imageURL1 = "../images/07News/news" + id + "image1Thumb.jpg"; } Works...
  2. croyce

    JSP - Checking if a file exists.

    ServletContext app = getServletContext(); String path = app.getRealPath(""); File theFile = new File(path + "/images/07News/news/" + "news4image1.jpg"); out.print("File Exists: " + theFile.exists() + "<br>"); I've got to be close? Cheers
  3. croyce

    JSP - Checking if a file exists.

    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...
  4. croyce

    JSP - Checking if a file exists.

    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...

Part and Inventory Search

Back
Top