Forum Moderators: open
----
"num" = countfiles in directory "c:\folder"
<%if request("num") > "1" then%>
<img src="image.jpg">
<%end if%>
----
Any clues?
'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder("C:\InetPub\wwwroot\folder")
'Loop through the Files collection
Dim objFile, fileCount
fileCount = 0
For Each objFile in objFolder.Files
if lcase(right(objFile.Name, 4)) = ".jpg" then
fileCount = fileCount + 1
end if
Next
'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
This will count all JPGs, you can take out the if statement if you want to count all files, or adjust it as necessary,
Chip-
I know the if state ment would be
<%if request("---") > "0" then%>
<img src="image.jpg">
<%end if%>
what would I replace "---" with?