ImagesIn

Just like FilesIn function, but this one returns list of images only found in a folder.
Images defined here are files with extension of .jpg, .png, .gif and .jpeg

Function ImagesIn(HTMLFolder, Sepa)
 Rett      = ""
 If Sepa = "" Then Sepa = Default_Sepa
 dim fo,x
 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 Rett > "" Then Rett = Rett & Sepa
   Rett     = Rett & x.Name
  End If
 Next
 Set fo     = Nothing
 ImagesIn     = Rett
End Function

HTMLFolder, Sepa

Views 206 Downloads 109

'FSO already defined', 'FilesIn', 'List', 'images', 'graphics. pictures', 'pix', 'FSO', 'files'

ANmarAmdeen
333
Graphics Classic ASP
Revisions

v1.0