Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Directory browsing

0 views
Skip to first unread message

TintinX

unread,
Oct 12, 2001, 5:08:29 AM10/12/01
to
Hi

I have a folder on my site called pdfproofs that I do not want to allow
directory browsing on.
However, I am dynamically creating subfolders underneath it that I DO want
to allow directory browsing on.

Is there any way that I can set IIS to do this without having to go in
manually every time a new subfolder is created to change the option?

Thanks


paul....@thecheshire.wantsnospam.co.uk

unread,
Oct 12, 2001, 6:53:48 AM10/12/01
to
On Fri, 12 Oct 2001 10:08:29 +0100, "TintinX" <tin...@here.com>
wrote:

I don't know of a way to do this, but what I would do is enable
directory browsing for this folder, but enable a default document like
_index.htm, and drop one in with just "Directory Browsing is not
enabled" in it (or even a .asp page which redirects you to somewhere
else).

HTH
Paul

Ed Astle

unread,
Oct 12, 2001, 8:34:01 AM10/12/01
to
"TintinX" <tin...@here.com> wrote in message
news:10028776...@eos.uk.clara.net...

Checkout the IIsWebDirectory COM object, in particular the DirBrowseFlags
property.

You'll probably need to be authenticated to create/use these type of objects
in asp - anonmymous users tend to fail with access denied errors. If your
creating them within a service or app then you should have enough rights
arlready.

I haven't actually used IIsWebDirectory but here's a snippet of asp where I
use the IIsWebServer object:

private sub inc_IIS_CheckServerId( ByRef nWebServerInstance )
' if instance = -1 then get the instance of the current web site
if nWebServerInstance = -1 then
nWebServerInstance = CInt( Request.ServerVariables("INSTANCE_ID") )
end if
end sub

private function inc_IIS_GetWebServer( ByVal nWebServerInstance )
' returns an IIsWebServer object for the web server instance given
dim sComputerPath

call inc_IIS_CheckServerId( nWebServerInstance )
sComputerPath = "IIS://" & Request.ServerVariables( "SERVER_NAME" ) & _
"/w3svc/" & CStr(nWebServerInstance)
set inc_IIS_GetWebServer = nothing
set inc_IIS_GetWebServer = GetObject( sComputerPath )

if not inc_IIS_GetWebServer is nothing then
if inc_IIS_GetWebServer.Class <> "IIsWebServer" then
set inc_IIS_GetWebServer = nothing
end if
end if
end function

Hope this helps,
Ed.

0 new messages