[thelist] ASP: FileSystemObject.FileExists

Anthony Baratta Anthony at Baratta.com
Wed Apr 14 16:39:55 CDT 2004

At 02:08 PM 4/14/2004, Casey Crookston wrote:
>I'm trying to use FileSystemObjects to see if a picture exists.  If it
>does... show it.  If not, show a "Picture not available" pic.  But, even if
>the pic DOES exist my script seem seems to think it doesn't.
>What am I doing wrong?

You can't use the full url to find your file. You need to use the virtual 
path and name, with Server.MapPath(/virt/dir/to/file/name.ext), then pass 
this to your Check if Exists function.

The File System Object needs the "real" path, not the URL.

More information about the thelist mailing list