November 30th, 2002, 11:21 PM
How to see if an image file exists
I'm building some dynamic image links based on if the image file exists.
I've messed around some with FileSystemObject but so far no success.
Thanks in advance for any suggestions.
Comments on this post
December 1st, 2002, 01:52 AM
The FileSystemObject has a method called fileExists(). Use this to check. You may have to use the server method, server.mappath, to ensure that you are using the full path to the file.
set fso = server.createObject("Scripting.FileSystemObject")
if fso.fileExits(server.mappath("relative/file/path")) then
response.write "file exists"
response.write "file does not exist"
December 1st, 2002, 01:55 AM
And you know I mean that.