"EQNish" <EQ****@discussions.microsoft.comwrote in message
news:59**********************************@microsof t.com...
IS there a way I can do an If exist to determin if a graphic is displayed?
something like this;
<p align="center">
if file exist "fileone.jpg"
<img border="0" src="fileone.jpg">
if File exist "filetwo.jpg"
<img border="0" src="fileone.jpg">
</p>
What I am trying to do is post JPGs from a folder structure, the files may
or maynot be there, but I don't want to have the blank picture reference
to
be displayed as if I where to just hard code the graphics in the Html!
Try this (warning air code):-
<%
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim fileNames
fileNames= Array("fileone.jpg", "filetwo.jpg") 'Note these are URL paths
%>
<p align="center">
<%
Dim fileName
For Each fileName in fileNames
If fso.FileExists(Server.MapPath(fileName)) Then
%>
<img border="0" src="<%=fileName%>" />
<%
End If
Next
%>
</p>
--
Anthony Jones - MVP ASP/ASP.NET