Hittade detta script på aspin, men det sorteras efter filnamn hur ska jag skriva så att listan sorteras efter datum? senaste överst på sidan???
<% @LCID = 1053 %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
' Just wrap your existing page around this code.
' put in the folder name below relative to the directory that this script is in
' DO NOT put leading or trailing slashes though.
' DO NOT use backslashes at all regardless of the server your on.
folder = ""
' The table shows the filename as a link, the date last modified and the file size
' Adjust the table and columns as needed. Delete columns if you don't need them
' Find out what type of server we are on and the server data
If Left(server.mappath("."),1) = "/" Then
strslash = "/"
Else
strslash = "\"
End If
servername = Request.Servervariables("server_name")
scriptpath = Request.Servervariables("script_name")
scriptpath = Mid(scriptpath,(Instrrev(scriptpath, "/")),1)
Dim filesobj, fileslist, fname, posnumright
dim f, dflm
Set filesobj = Server.CreateObject("scripting.filesystemobject")
Set fileslist = filesobj.GetFolder(server.mappath(".") & "/" & folder)
%>
<!-- ************* Table start and header row ****************-->
<table width="95%">
<tr>
<td width="50%">File</td><td>Date</td><td>Size</td></tr>
<%
For each thing In fileslist.files
posnumright = instrrev(thing, strslash)
fname = right(thing,(len(thing)-posnumright))
Set f = filesobj.GetFile(thing)
fdlm = f.datelastmodified
If f.size > 1023 Then
fsize = CStr(CInt(f.size / 1024)) & "K"
Else
fsize = CStr(f.size) & " bytes"
End If
physicalpath = server.mappath(".")
%>
<tr>
<td>
<!-- ******* First column with link to file name ******* -->
<a href="http://<%=servername & scriptpath & folder & "/" & Server.HTMLEncode(fname) %>" target="_blank"><%=Server.HTMLEncode(fname)%></a>
</td>
<td>
<!-- ******* Second column with last modified date of file ***** -->
<%=Server.HTMLEncode(fdlm)%>
</td>
<td>
<!-- ******* Third column with file size ******** -->
<%= Server.HTMLEncode(fsize) %>
</td>
</tr>
<%
Set f = Nothing
Next
Set fileslist = Nothing
Set filesobj = Nothing
%>
<!-- *************** End of Table ****************** -->
</table>
</body>
</html>