Click to See Complete Forum and Search --> : How to check if a file exists in a folder with ASP


telmessos
04-21-2006, 04:53 AM
Hi everbody,

I would like to learn to check if a file exists in folder. I will use it for file deletions in an admin page. I want my code if a picture exists in the folder. If yes delete it if no pass to the next codes

Thank you

Ceyhun

lmf232s
04-21-2006, 01:31 PM
Use FSO
Here is a useful link that will show you how to use FSO
http://www.tutorial-web.com/asp/fso/filesystem.asp?property=FileExists

filename="c:\test\test.html"
Set fso = CreateObject("Scripting.FileSystemObject")
response.write fso.fileExists(filename)