[thelist] ASP: FileSystemObject.FileExists

darren darren at web-bitch.co.uk
Wed Apr 14 16:25:43 CDT 2004


On Wednesday, April 14, 2004 at 22:08, Casey Crookston wrote:

CC> I'm trying to use FileSystemObjects to see if a picture exists.  If it
CC> does... show it.  If not, show a "Picture not available" pic.  But, even if
CC> the pic DOES exist my script seem seems to think it doesn't.

CC> What am I doing wrong?

CC> CheckFileExists("http://www.boserconstruction.com/~test/art/port/41_1.jpg")

casey,

instead of using a url for the image, use the relative or full path.  you
can get the full path by using server.mappath.

e.g.:

   fileName = "/art/port/41_1.jpg"

   if CheckFileExists(Server.MapPath(fileName)) then
      ...
   end if

hth,

darren.



More information about the thelist mailing list