Reads folder contents and links drop down selector to download
<form name="form1" method="post" action="backup.asp">
<table width="100%" border="0" cellpadding="2">
<tr>
<td class="smallspecialbold" nowrap>Select Download File</td>
<td width="100%">
<select name="downloadfile">
<%'Joel Martinez 2001
dim jm_fso, jm_file, jm_types, jm_path, jm_folder,jm_show,jm_i,jm_ext
jm_ext=true
jm_path = databasefolder
jm_types = split(replace("bmp,bak,mdb"," ",""),",")
Set jm_fso = Server.CreateObject("Scripting.FileSystemObject")
Set jm_folder = jm_fso.GetFolder(Server.MapPath(jm_path))
For Each jm_file in jm_folder.Files
jm_show=false
for jm_i=0 to ubound(jm_types,1)
If lcase(right(jm_file.name,3)) = jm_types(jm_i) then jm_show=true
next
If jm_show=true then
if jm_ext=true then
response.write "<option value="""& jm_path & jm_File.Name & """>" & jm_File.Name & "</option>" &vbcrlf
else
response.write "<option value="""& jm_path & jm_File.Name & """>" & mid(jm_File.Name,1,len(jm_File.Name)-4) & "</option>" &vbcrlf
end if
end if
next
set jm_file=nothing
set jm_folder = nothing
set jm_fso=nothing%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" class="button" name="Submit" value="Download Backup">
</td>
</tr>
</table>
</form>
|