anneoctaaf
Programmer
I need some help with getting all the picturenames - which are in an imagefolder on the webserver - into a dropdownlistbox.
Thanx!
Thanx!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<SELECT name="myImages">
<%
strImageFolder = "C:\Temp\myImages"
Set objFSO = Server.CreateObject("Scripting.FileSystemObjext")
Set objFolder = objFSO.GetFolder(strImageFolder)
For Each strFile in objFolder.Files
If InStr(strFile.Name,".jpg") OR InStr(strFile.Name,".gif) Then
Response.Write "<OPTION>" & strFile.Name & "</OPTION>" & vbcrlf
End If
Next
Set objFolder = Nothing
Set objFSO = Nothing
%>
</SELECT>
If Right(strFile.Name, 4) = ".jpg" OR Right(strFile.Name, 4) =".gif" Then
Function IsImage(Value)
on error resume next
TempArr = Split(lcase(Value),".")
FileExt = TempArr(Ubound(TempArr))
Select Case FileExt
' dont let this next line wrap
Case "bmp","dip","rle","emf","iff","lbm","ilbm","jpg","jpe","jpeg","jif","jiff","kdc","pcd","pcx","dcx","pic","pix","png","psd","tga","tif","tiff","wmf"
IsImage = True
Case Else
IsImage = False
End Select
End Function