M
.:mmac:.
I am listing a set of files using the following script:
<% set directory = Server.CreateObject("Scripting.FileSystemObject")
set allfiles = directory.GetFolder(Server.MapPath("/mmm/lesson/"))
For Each directoryfile in allFiles.files
Response.Write "<a href='/mmm/lesson/" & directoryfile.name & "'>" &
directoryfile.name & "</a>"
Next %>
This displays great (thanks Roland!)but the (minor) problem is that the
names are WeekX.pdf where X= week of year.
So the list is displayed as :
Week1.pdf
Week10.pdf
Week11.pdf
Week12.pdf
....
Week19.pdf
Week2.pdf
Week20.pdf
etc
How can I display the list numerical order and also trim it so that the
".pdf" is not shown?
I imagine there is trim function I can use to remove the extension, but I
have no clue how to sort these numerically this way.
<% set directory = Server.CreateObject("Scripting.FileSystemObject")
set allfiles = directory.GetFolder(Server.MapPath("/mmm/lesson/"))
For Each directoryfile in allFiles.files
Response.Write "<a href='/mmm/lesson/" & directoryfile.name & "'>" &
directoryfile.name & "</a>"
Next %>
This displays great (thanks Roland!)but the (minor) problem is that the
names are WeekX.pdf where X= week of year.
So the list is displayed as :
Week1.pdf
Week10.pdf
Week11.pdf
Week12.pdf
....
Week19.pdf
Week2.pdf
Week20.pdf
etc
How can I display the list numerical order and also trim it so that the
".pdf" is not shown?
I imagine there is trim function I can use to remove the extension, but I
have no clue how to sort these numerically this way.