[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

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.

0
robrodp
Asked:
robrodp
1 Solution
 
sam_norianCommented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now