martineit
asked on
Sorting IIS Directory Browsing
Dear Experts,
I'm trying to implement an simple web page for listing documents within a folder giving the user the possibility to sort files by name, size or date.
So far the best code I found on the internet is this: http://www.daleanderson.ca/edb/
The display is fairly nice but it only allows me to sort A->Z not Z->A and I need both.
My server is a Windows 2003 SP2 (IIS6) and I have no plan to migrate to Windows 2008 any time soon.
I have two questions:
Do you have any better way to implement this kind of sorting?
Do you think this could be achieved with JS (in particularly big folders it would come useful to do the sorting client side)?
P.S.: WebDav at the moment is not an option
Thank you,
Roberto.
I'm trying to implement an simple web page for listing documents within a folder giving the user the possibility to sort files by name, size or date.
So far the best code I found on the internet is this: http://www.daleanderson.ca/edb/
The display is fairly nice but it only allows me to sort A->Z not Z->A and I need both.
My server is a Windows 2003 SP2 (IIS6) and I have no plan to migrate to Windows 2008 any time soon.
I have two questions:
Do you have any better way to implement this kind of sorting?
Do you think this could be achieved with JS (in particularly big folders it would come useful to do the sorting client side)?
P.S.: WebDav at the moment is not an option
Thank you,
Roberto.
ASKER
Hi,
thank you for your answer. I know I could achieve that by using FSO sorting but I wanted to avoid to re-write code, it seems unbelivable to me that noone ever wrote this code.
I've already found a way to obtain the reverse (z->a) sorting by simply taking the code from the link I posted originally and did a reverse array.
Now I'm actually more interested in finding a way to do the sorting using JS (to compare the execution time for each solution), has anyone ever done that?
Thanks,
Roberto.
thank you for your answer. I know I could achieve that by using FSO sorting but I wanted to avoid to re-write code, it seems unbelivable to me that noone ever wrote this code.
I've already found a way to obtain the reverse (z->a) sorting by simply taking the code from the link I posted originally and did a reverse array.
Now I'm actually more interested in finding a way to do the sorting using JS (to compare the execution time for each solution), has anyone ever done that?
Thanks,
Roberto.
If don't want to rewrite the code, you can try to use the sort in querystring:
For Example, sort=1 is Z to A
http://www.daleanderson.ca/edb/download/Default.asp?sort=1&FolderSpec=%2Fedb%2Fdownl oad
sort=2 is A to Z
http://www.daleanderson.ca/edb/download/Default.asp?sort=2&FolderSpec=%2Fedb%2Fdownl oad
So by this way you can only add a code to set 2 as default.
Hope this help.
For Example, sort=1 is Z to A
http://www.daleanderson.ca/edb/download/Default.asp?sort=1&FolderSpec=%2Fedb%2Fdownl
sort=2 is A to Z
http://www.daleanderson.ca/edb/download/Default.asp?sort=2&FolderSpec=%2Fedb%2Fdownl
So by this way you can only add a code to set 2 as default.
Hope this help.
ASKER
Hello,
As I said in my previous post: "I've already found and applied the ASP solution".
At the moment I would like to find out if it's possible to do the same using JS.
Any idea?
Thanks,
Roberto.
As I said in my previous post: "I've already found and applied the ASP solution".
At the moment I would like to find out if it's possible to do the same using JS.
Any idea?
Thanks,
Roberto.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Doesn't really answer my question and right now I don't have time to "have a look" at something (I was hoping for some ready made piece of code).
Sorting is by the line
rsFSO.Sort = "Type DESC, Size ASC "
A bit of form request and logic would be able to change the sort depending on the links,
FSO Sort Folder Contants
Is this the sort of thing your looking for (before I spend while looking at it)