asp scriptto populate a select list wirh .xls files from a folder in the web

I need to have a select list populated with certain files (mainly .xls) that are in a folder on the web.

robrodpAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sam_norianConnect With a Mentor Commented:
Hi, How about this....

<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder(Server.MapPath(".") & "\..\Your Folder\")
%>
<select name="FileList">
<%
 
for each x in fo.files
  Response.write("<option value=" & CHR(32) & x.name & CHR(32) & ">" & x.name & "</option>")
next
 
set fo=nothing
set fs=nothing
%></select>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.