I have a website that has a drop down menu that dynamically contains reports in a specific folder. Is there a way to sort this by the date of those files (they're usually just HTML files), instead of alphabetically?
I also would like the ability to only show the most recent files (say 10 or so), then have a link to a page containing the rest of them.
Also, is there a way to remove the file extension that is shown on these files in the drop down menu?
Lastly, I would like the ability to make that ul field a link to the most recent file in that folder (maybe tied in with the first question I had). That way, an employee can click on the title of that drop down menu and open the most recent file.
Here is the code I have for it now:
<%
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("docs/"))
For each filefound in MyFiles.files
%>
<li>
<a href="docs/<% =filefound.Name %>" target="blank"><% =filefound.Name %></a>
</li>
<% Next %>
Thanks a bunch!
I also would like the ability to only show the most recent files (say 10 or so), then have a link to a page containing the rest of them.
Also, is there a way to remove the file extension that is shown on these files in the drop down menu?
Lastly, I would like the ability to make that ul field a link to the most recent file in that folder (maybe tied in with the first question I had). That way, an employee can click on the title of that drop down menu and open the most recent file.
Here is the code I have for it now:
<%
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("docs/"))
For each filefound in MyFiles.files
%>
<li>
<a href="docs/<% =filefound.Name %>" target="blank"><% =filefound.Name %></a>
</li>
<% Next %>
Thanks a bunch!