ASP
Here you can find some FREE usefull Classic ASP / VBScript code snippets, class modules, etc.
Function FileExists(String)Boolean
Check if a local file exists.
Example
<% if FileExists("C:\inetpub\www\myfolder\myfile.zip") then response.write "My file DOES exist on this server!" else response.write "Cannot find my file here..." end if %> Source Code <%
Function FileExists(filename) dim fso, filepath if mid(filename,2,1)<>":" and left(filename,2)<>"\\" then filepath = Server.MapPath(filename) else filepath = filename set fso = CreateObject("Scripting.FileSystemObject") FileExists = fso.FileExists(filepath) set fso = nothing End Function %> |