ImagesIn_Count

Counts number of image files found in a folder
Images defined here are files with extension of .jpg, .png, .gif and .jpeg
Ignoring images with name Icon1.*

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ImagesIn_Count(HTMLFolder)
Retu = 0
ServerFolder = Server.MapPath(HTMLFolder)
set fo = fso.GetFolder(ServerFolder)
For each x in fo.files
Extt = UCase(Right(x.Name, 4))
If Extt = ".JPG" Or Extt = "JPEG" or Extt = ".PNG" or Extt = ".GIF" Then
If UCase(x.Name) = "ICON1.GIF" Or UCase(x.Name) = "ICON1.JPG" Or UCase(x.Name) = "ICON1.PNG" Then
Else
If x.name > "" Then Retu = Retu + 1
End If
End If
Next
ImagesIn_Count = Retu
End Function

HTMLFolder

Views 3,581

Downloads 1,143

CodeID
DB ID