Interesting one : Retrieve a list of files within a web folder

Discussion in 'ASP .Net' started by John, Oct 22, 2004.

  1. John

    John Guest

    Hi all,

    I haven't a clue where to begin here (or more to the point - if it's even
    possible).

    I need to read the names of all the files inside a folder off my web site.
    The catch here is that I don't know the absolute path here
    (C:\inetpub\whatever\whatever\etc...) as it could be on any drive at my ISP.

    Is there a way to retrieve a list of these files by somehow using the
    relative path (../Images/photos/*)?

    Regards
    John.
     
    John, Oct 22, 2004
    #1
    1. Advertising

  2. John

    Brian Hoops Guest

    use
    server.mappath("images/photos/")


    "John" <> wrote in message
    news:%...
    > Hi all,
    >
    > I haven't a clue where to begin here (or more to the point - if it's even
    > possible).
    >
    > I need to read the names of all the files inside a folder off my web site.
    > The catch here is that I don't know the absolute path here
    > (C:\inetpub\whatever\whatever\etc...) as it could be on any drive at my
    > ISP.
    >
    > Is there a way to retrieve a list of these files by somehow using the
    > relative path (../Images/photos/*)?
    >
    > Regards
    > John.
    >
    >
     
    Brian Hoops, Oct 23, 2004
    #2
    1. Advertising

  3. John

    Mythran Guest

    Hrm, using VB.Net as follows:

    Server.MapPath("../Images/photos") will give you the absolute path.

    Hope that helps :)

    Also, I believe the relative path may work also...maybe not.

    Mythran


    "John" <> wrote in message
    news:%...
    > Hi all,
    >
    > I haven't a clue where to begin here (or more to the point - if it's even
    > possible).
    >
    > I need to read the names of all the files inside a folder off my web site.
    > The catch here is that I don't know the absolute path here
    > (C:\inetpub\whatever\whatever\etc...) as it could be on any drive at my
    > ISP.
    >
    > Is there a way to retrieve a list of these files by somehow using the
    > relative path (../Images/photos/*)?
    >
    > Regards
    > John.
    >
    >
     
    Mythran, Oct 23, 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. THY
    Replies:
    3
    Views:
    2,957
    Alvin Bruney
    Oct 16, 2003
  2. Grant Merwitz
    Replies:
    0
    Views:
    5,391
    Grant Merwitz
    Jun 21, 2005
  3. Replies:
    4
    Views:
    2,160
  4. =?Utf-8?B?a2V2aW4=?=

    exclude obj folder in web install folder

    =?Utf-8?B?a2V2aW4=?=, Aug 20, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    580
    =?Utf-8?B?a2V2aW4=?=
    Aug 20, 2007
  5. Replies:
    7
    Views:
    411
    Gabriel Genellina
    Sep 25, 2007
Loading...

Share This Page