Join 3,497 readers in helping fund MetaFilter (Hide)


How can I get IIS's Directory Browser to sort numbers like numbers, and not alphabetically?
September 6, 2011 11:55 AM   Subscribe

How can I get IIS's Directory Browser to sort numbers like numbers, and not alphabetically?

Is there a way (or a third-party module I can use instead) that will let IIS's Directory Browsing module sort numbers like 1,2,3,4,5... instead of 1,10,11,12...19,2,20,21... ?

If you're not sure what I mean, I have a screenshot here.

IIS7 on Windows 7 Pro, if it matters.
posted by John Kenneth Fisher to Computers & Internet (9 answers total)
 
The traditional way to do this for any file/directory grouping is to insert a 0 before single digit numbers. i.e. instead of "1" it would be "01".
posted by dukes909 at 11:58 AM on September 6, 2011


Yeah... but that's just ugly. And since some of the items aren't far from quadruple digits, everything will be padded to 0001, 0002, 0003 ? Sheesh. There has to be a way to get numbers to be treated like numbers. Both Windows Explorer and the Macintosh Finder do it swimmingly.
posted by John Kenneth Fisher at 12:16 PM on September 6, 2011


A similar question (& answer)? I don't have IIS so I can't test this, sorry.
posted by dukes909 at 12:28 PM on September 6, 2011 [1 favorite]


In PHP there is a "SORT_NUMERIC" flag for the sort function, I assume there is something like that in ASP
posted by yeahyeahyeahwhoo at 12:32 PM on September 6, 2011 [1 favorite]


If you are willing to write some code, there is a way to create your own directory listing module. Just briefly looking at their code it looks like you can introduce your own custom sorting logic.
posted by mmascolino at 12:53 PM on September 6, 2011 [1 favorite]


I'm stumped trying to figure out a way to do it that does not require code. I even asked the IIS admin I work with, maybe we are just not that smart. Seems crazy to have to write asp.net to do this. You will have to drop a default.aspx in every folder you want sorted, or write some sort of custom handler like the one mmascolino linked to.
posted by Ad hominem at 1:05 PM on September 6, 2011 [1 favorite]


At least I'm not alone in thinking it's nuts to need to write code for this.
posted by John Kenneth Fisher at 5:13 PM on September 6, 2011


Web server directory listings are a simple, basic legacy function and its not really made to be used the way windows explorer or finder is, which have spent years being tuned for end users. Production web sites end up turning it off for security reasons anyway, so it's not exactly in demand as a feature, that's why things like dropbox are used so much. Checking around, a product like this might do what you want or get you in the right direction.
posted by yeahyeahyeahwhoo at 11:15 AM on September 7, 2011


Yeah, spending 260 bucks for things to be in human number order not a good solution. And rolling my own module was just nutty. The answer, for those of you playing at home? Was to DELETE IIS AND JUST USE APACHE. Cause, as it always has for me in the past, it works beautifully.

((grumble))
posted by John Kenneth Fisher at 11:38 PM on September 10, 2011


« Older [Possibly NSFW] Is it normal f...   |  A couple of questions about se... Newer »
This thread is closed to new comments.