Dynamic Directory Listings

Discussion in 'ASP General' started by Dan King, Aug 2, 2004.

  1. Dan King

    Dan King Guest

    I have an ASP page that currently gives me an output of file listing with
    links to each of them for the current directory.
    The problem I am having is there are getting to be too many folders. I
    currently have the ASP page copied into each folder and sub folder, but if I
    want to make a change, I have to change all the ASP files.

    Is there a way I can create either:
    Have a simple index.asp page that will reference and run my code in my
    current ASP page? This way I have only one complex file to change, and
    simple index in each folder.

    Or

    Can I create an index page at the root of the server that will give me a
    folder listing, and then when I click on a link to a folder it can pass the
    new current directory to the root index page to give a listing of the new
    current directory?

    Any code snippets would be appreciated.

    I am currently using directory listings in IIS, but this is an ugly way, and
    I want to be able to clean it up.

    Thanks,
    Dan

    --
    __o
    _-\<,
    (_)/(_)____
     
    Dan King, Aug 2, 2004
    #1
    1. Advertising

  2. Dan King

    Steven Burn Guest

    You can use a single page in the root, and Request.Querystring() to
    determine the folder to be read.

    <%
    strTemp = request.querystring("folder")
    if strTemp = "" then strTemp = "./" '// current folder
    set fldr = fso.getfolder(server.mappath(strtemp))
    %>

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "Dan King" <> wrote in message
    news:...
    > I have an ASP page that currently gives me an output of file listing with
    > links to each of them for the current directory.
    > The problem I am having is there are getting to be too many folders. I
    > currently have the ASP page copied into each folder and sub folder, but if

    I
    > want to make a change, I have to change all the ASP files.
    >
    > Is there a way I can create either:
    > Have a simple index.asp page that will reference and run my code in my
    > current ASP page? This way I have only one complex file to change, and
    > simple index in each folder.
    >
    > Or
    >
    > Can I create an index page at the root of the server that will give me a
    > folder listing, and then when I click on a link to a folder it can pass

    the
    > new current directory to the root index page to give a listing of the new
    > current directory?
    >
    > Any code snippets would be appreciated.
    >
    > I am currently using directory listings in IIS, but this is an ugly way,

    and
    > I want to be able to clean it up.
    >
    > Thanks,
    > Dan
    >
    > --
    > __o
    > _-\<,
    > (_)/(_)____
    >
    >
     
    Steven Burn, Aug 2, 2004
    #2
    1. Advertising

  3. Dan King

    Dan King Guest

    Thanks Steve. After a little tweaking, I got it to work.

    Dan

    "Steven Burn" <> wrote in message
    news:%23J$...
    > You can use a single page in the root, and Request.Querystring() to
    > determine the folder to be read.
    >
    > <%
    > strTemp = request.querystring("folder")
    > if strTemp = "" then strTemp = "./" '// current folder
    > set fldr = fso.getfolder(server.mappath(strtemp))
    > %>
    >
    > --
    >
    > Regards
    >
    > Steven Burn
    > Ur I.T. Mate Group
    > www.it-mate.co.uk
    >
    > Keeping it FREE!
    >
    >
    > "Dan King" <> wrote in message
    > news:...
    > > I have an ASP page that currently gives me an output of file listing

    with
    > > links to each of them for the current directory.
    > > The problem I am having is there are getting to be too many folders. I
    > > currently have the ASP page copied into each folder and sub folder, but

    if
    > I
    > > want to make a change, I have to change all the ASP files.
    > >
    > > Is there a way I can create either:
    > > Have a simple index.asp page that will reference and run my code in my
    > > current ASP page? This way I have only one complex file to change, and
    > > simple index in each folder.
    > >
    > > Or
    > >
    > > Can I create an index page at the root of the server that will give me a
    > > folder listing, and then when I click on a link to a folder it can pass

    > the
    > > new current directory to the root index page to give a listing of the

    new
    > > current directory?
    > >
    > > Any code snippets would be appreciated.
    > >
    > > I am currently using directory listings in IIS, but this is an ugly way,

    > and
    > > I want to be able to clean it up.
    > >
    > > Thanks,
    > > Dan
    > >
    > > --
    > > __o
    > > _-\<,
    > > (_)/(_)____
    > >
    > >

    >
    >
     
    Dan King, Aug 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brent
    Replies:
    1
    Views:
    451
    Craig Deelsnyder
    Jun 10, 2005
  2. Blogger Team

    Free Listings in Blog directory

    Blogger Team, Nov 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    371
    Blogger Team
    Nov 27, 2005
  3. Chris McMahon
    Replies:
    11
    Views:
    720
    Chris McMahon
    Jun 27, 2005
  4. Carolyn Speakman

    Getting directory listings from a client machine

    Carolyn Speakman, Aug 20, 2004, in forum: ASP General
    Replies:
    1
    Views:
    273
    Jeff Cochran
    Aug 20, 2004
  5. simonh
    Replies:
    6
    Views:
    138
    simonh
    Aug 12, 2010
Loading...

Share This Page