PaulBricker
Programmer
I have an asp page that takes the names of all the files in a Folder and creates a link to them so users can open the files. Now I have a little wrinkle. They decided to store all the files in subfolders. I changed my original code so I can open all the subfolders as links, but now I need to capture the name of the subfolder link that is clicked so I can display the files in those subfolders as links. I know I could write an asp page for each subfolder and put the physical path to each subfolder in, but I'd like to write one asp page and pass the name of the subfolder link clicked to the page. Is there any way to do this? Here is the relevent code I'm using to get my files.
<%
Dim fso, f, files
Dim i
i = 0
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("E:/WEBSITE/businessOffice/BudgetReports/subfolderNameHere")
set files=f.Files
%><div id = "content"><%
for each file in files
If i mod 3 = 0 Then
Response.Write "<p><a href=" & Chr(34) & "subfolderNameHere" & file.Name & Chr(34) & "></p>"
Response.Write file.Name & "</a>  "
Else
Response.Write "<a href=" & Chr(34) & "subfolderNameHere" & file.Name & Chr(34) & ">"
Response.Write file.Name & "</a>  "
End If
i = i+1
next
%></div><%
Set objFolder = Nothing
Set objFSO = Nothing
%>
Thanks
Paul
<%
Dim fso, f, files
Dim i
i = 0
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("E:/WEBSITE/businessOffice/BudgetReports/subfolderNameHere")
set files=f.Files
%><div id = "content"><%
for each file in files
If i mod 3 = 0 Then
Response.Write "<p><a href=" & Chr(34) & "subfolderNameHere" & file.Name & Chr(34) & "></p>"
Response.Write file.Name & "</a>  "
Else
Response.Write "<a href=" & Chr(34) & "subfolderNameHere" & file.Name & Chr(34) & ">"
Response.Write file.Name & "</a>  "
End If
i = i+1
next
%></div><%
Set objFolder = Nothing
Set objFSO = Nothing
%>
Thanks
Paul