hej, jag har ett script som listar filer i en mapp på servern, nu skulle jag vilja ha det i en dropmeny, men vet inte riktigt hur jag ska skriva for satsen för att få varje fil på egen rad.
Här är scriptet som jag har för att lista filerna:
<%
Function ShowFileList(strPath)
Dim objFS, objFolder, objFile, strFiles
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(strPath)
strFiles=""
For Each objFile in objFolder.Files
strFiles = strFiles & objFile.Name & "<br>"
Next
Set objFolder=Nothing
Set objFS=Nothing
ShowFileList=strFiles
End Function
<%
Function ShowFileList(strPath)
Dim objFS, objFolder, objFile, strFiles
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(strPath)
strFiles=""
For Each objFile in objFolder.Files
strFiles = strFiles & "<option>" & objFile.Name & "</option>"
Next
Set objFolder=Nothing
Set objFS=Nothing
ShowFileList=strFiles
End Function
%><select>
<%=ShowFileList("c:\download")%>
</select>