jerusking
06-26-2007, 08:06 AM
Hi guys, any idea about filtering files on the mappath folder? I have sample codes for you to see. I just need to view jpg files, let say i have .pdf and .doc on that folder and i just want jpg to view. Thanks
Dim oFilesys, oFolder, oFile, i
Set oFilesys= CreateObject("Scripting.FileSystemObject") Set oFolder= oFilesys.GetFolder(Server.MapPath("/images/" & id & "/"))
i=0
For Each oFile in oFolder.Files
strHTML = strHTML & "<td width='40' height='30'><img src='http://www.edwardsandtowers.com/images/"& RS("propcode") &"/" & oFile.Name &"' style='width:40px; height:30px;' border='0'></td>"
i=i+1
if i = 7 then
strHTML = strHTML & "</tr><tr>"
end if
next
strHTML = strHTML & "</tr></table>"
Set oFolder=Nothing
Set oFilesys=Nothing
Dim oFilesys, oFolder, oFile, i
Set oFilesys= CreateObject("Scripting.FileSystemObject") Set oFolder= oFilesys.GetFolder(Server.MapPath("/images/" & id & "/"))
i=0
For Each oFile in oFolder.Files
strHTML = strHTML & "<td width='40' height='30'><img src='http://www.edwardsandtowers.com/images/"& RS("propcode") &"/" & oFile.Name &"' style='width:40px; height:30px;' border='0'></td>"
i=i+1
if i = 7 then
strHTML = strHTML & "</tr><tr>"
end if
next
strHTML = strHTML & "</tr></table>"
Set oFolder=Nothing
Set oFilesys=Nothing