Chris Crowe's Blog
Ramblings of an IIS MVP ( MVP Since 1997 )

Powered By IIS 7

Search my blog

Some of my readers



My Microsoft Certifications


Dec 15, 1998

Dec 20, 2000

Jan 31, 2001

Jul 22, 2002

Nov 1, 2004

My Microsoft MVP Awards




1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
mvp.support.microsoft.com

IIS supports a directory browsing mode where you can view a list of files and directories instead of viewing an HTML page.

This is very useful for example when you have a lot of files and folders such as an MP3 collection.

To enable this mode you select either a Physical or Virtual directory in the Internet Information Services application and select properties and then select the Directory Browsing check box as shown below.

Once you enable this option when you browse to the directory or any child directories they will be shown using the built in directory browsing module.

In the above view there is a single file and a single directory displayed, and they map to the following physical directory which is the home directory for the web site; in this case c:\inetpub\websites\directorybrowsing

Hiding Files

If you have some files in your directory that you do not want the user to see you must mark them as Hidden using the Windows Explorer file properties dialog.

Note: If you mark the file as hidden even if you know the name of the file you can not download the file (an HTTP 404 error will be produced)

Why do my Virtual Directories not show up in the browse list?

In the example above we have a virtual directory called Music which is pointing to e:\music (directory browsing has been enabled for the Web Site Root and also for the Music Virtual directory)

When you browse the web site you do not see the Music Virtual directory.

This is a special case where IIS does not show the virtual directory but if you knew the name of the virtual directory and manually entered it into the address bar you would see the files as shown below.

The way to make sure your users can see the virtual directory while they are browsing the root is to create a physical directory with the same name in the physical folder of the parent directory.

So in our case our parent directory points to c:\inetpub\websites\directorybrowsing so we must create a folder called Music in the c:\inetpub\websites\DirectoryBrowsing folder.

Nothing has to exist in this new empty Music directory and as soon as you create the folder and refresh the listing you will see the directory shown in the web browser and you have the ability to navigate into it as we would any other directory.

Applying your own style to the directory listing

You can't.....

posted on Saturday, March 18, 2006 8:35 AM | Filed Under [ IIS IIS / Tools / Administration ]

Comments


# re: IIS Directory Browsing

Gravatar
You can add your own style to the directory listings actually.

Posted by Tony on 4/18/2007 9:52 PM

# re: IIS Directory Browsing

Gravatar
Hi Tony

IIS 6 and below you can not change the directory listing module ( well I suppose you could write a C++ ISAPI filter to do it )

IIS 7 allows you to completly replace the directory listing module.

Posted by Chris Crowe on 4/18/2007 9:59 PM

# re: IIS Directory Browsing

Gravatar
See this url for some sample code for IIS 7 on how to replace the directory listing module.

http://mvolo.com/blogs/serverside/archive/2007/01/21/Get-nice-looking-directory-listings-for-your-IIS-website-with-DirectoryListingModule.aspx>

I know IIS 7 is currently only available on Vista Client, but soon on Long Horn Server.

Posted by Chris Crowe on 4/18/2007 10:05 PM

# re: IIS Directory Browsing

Gravatar
I've done it in IIS 5 running on Windows XP.

I put an index.asp file on each folder that is being listed, and then created a virtual directory for each folder.

So the directory browser looks for the index.asp file in the folder that it is trying to browse, and displays the contents in the that is set out in the asp file.

I can post the code if you want it.

Tony.
Posted by Tony on 4/19/2007 2:20 AM

# re: IIS Directory Browsing

Gravatar
Hi

Yes I understand that part by having to place a file in each folder and using any sort of scripting language or .NET language to render the page of files.

But in general you can not replace the built in functionallity so you do not have to have a file in each folder.
Posted by Chris Crowe on 4/19/2007 6:36 AM

# re: IIS Directory Browsing

Gravatar
Ahh yes that is true :)

Posted by Tony on 4/20/2007 12:00 AM

# re: IIS Directory Browsing

Gravatar
yes. could you please post the code for the index.asp it would be a big help.
Posted by Sean on 6/6/2007 7:48 AM

# re: IIS Directory Browsing


I agree, please post that code! I would like to see how to do that.
Posted by Andy on 6/7/2007 1:18 AM

# re: IIS Directory Browsing

Gravatar
I wrote myself a lovely little ASP script to do all the things that IIS 6 didn't provide that I wanted. It's very configurable, provides some degree of privacy, and you can paint it any color you like. You also only need to put it in one top directory, and it lets you browse recursively using itself.

Posted by Dale Anderson on 9/19/2008 10:03 AM

# re: IIS Directory Browsing

Gravatar
http://www.devnet.ca/edb
Posted by Dale Anderson on 9/19/2008 10:04 AM

# re: IIS Directory Browsing

Gravatar
If i dont want the user to open any path without authentication,wat should be done?
Posted by manasa on 10/3/2008 11:56 PM

# re: IIS Directory Browsing

Gravatar
i'm trying to set up virtual directories on my computer and I don't want to have to copy them to my home directory. I should be able to browse the directories if I set up authentication up the same as the home directory, but its still not working. what do I do?
Posted by carson on 10/22/2008 5:16 AM

# re: IIS Directory Browsing

Gravatar
How i can order the directory content? There's some parameters to add in qerystring url to sorting file names?
thanks. Luca
Posted by Luke on 10/29/2008 9:09 PM

# re: IIS Directory Browsing


Directory Browsing is very basic, you really have no control at all.

In IIS 7 you could write a simple module to handle directory listings or with earlier versions you would end up having to write an ISAPI Filter or possibly some code to render directory listings.
Posted by Chris crowe on 10/30/2008 7:34 AM

# re: IIS Directory Browsing

Gravatar
I am looking for web thumbnail view app for shared folders.
ie, make IE experience more like window explorers' when web browsing directories.
not having any luck finding it out there.
Posted by marshal on 11/28/2008 3:34 PM

# Can Directory browser settings in the Linux Fedora core9

Gravatar
hi all, I am a new user in linux fedora core9, and I want to ask, you may have to know how to setting Directory Browser on the linux fc9, thank top aid.
Posted by aBYaNa on 1/5/2009 7:28 PM

# re: IIS Directory Browsing

Gravatar
Hello,

I have been trying to setup virtual directories for awhile now on my vista box and i am running into an issue. Configuration.
User Isolation User name directory
physical directory setup of LocalUser/user
Show Virtual Directories checked
Windows Authenticated users only
Select user chosen (user)
When I setup one vd under my user i can log in and see it
but when i create a second vd under my user it gives me a
a 550 error.

And ideas.
or more info needed.

Any help would be appreciated
Posted by Jason on 1/22/2009 7:56 AM

# re: IIS Directory Browsing


What might cause IIS 7 to not support the recursive functionality of a Unix dir -R command? Is there a setting in IIS 7 that enables directory recursion?
Posted by Oscar on 4/18/2009 5:59 AM

# 紫冰


好像IIS的浏览功能,通过WEB显示,不能自动排列
Posted by ZB on 7/22/2009 10:36 PM

# re: IIS Directory Browsing

Gravatar
bt ganun ang labo sobra
Posted by jhen on 8/20/2009 1:53 PM

# re: IIS Directory Browsing


hi,
there is no virtual directory show in directory browsing
how this do it?
Posted by Anand on 11/20/2009 7:15 PM

Post Comment


Title *
Name *
Email
Url
Comment *  
Please add 3 and 5 and type the answer here: