show all files in the directory, but how to show directory control??

Discussion in 'HTML' started by strutsng@gmail.com, Sep 30, 2005.

  1. Guest

    I want to write an asp page that allows the user to choose the
    directory, and it will show all files in that directory.
    I used the tag <input type="file">, but this is for selecting a file,
    not directory.

    <form action="process.asp" method="post">
    <p><input type="file" name="mydir">
    <p><input type="submit">
    </form>

    'process.asp
    <%
    dim fs,fo,x,mydir
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    mydir = Request.Form("mydir")
    set fo=fs.GetFolder(mydir)
    for each x in fo.files
    Response.write(x.Name & "<br />")
    next
    set fo=nothing
    set fs=nothing
    %>


    any ideas? please advise. thanks!!
    , Sep 30, 2005
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 30 sep 2005 in microsoft.public.inetserver.asp.general:

    > I want to write an asp page that allows the user to choose the
    > directory, and it will show all files in that directory.
    > I used the tag <input type="file">, but this is for selecting a file,
    > not directory.
    >
    > <form action="process.asp" method="post">
    > <p><input type="file" name="mydir">


    type="text" [this is the default, so you cna leave it out]

    > <p><input type="submit">
    > </form>
    >
    > 'process.asp
    > <%
    > dim fs,fo,x,mydir
    > set fs=Server.CreateObject("Scripting.FileSystemObject")
    > mydir = Request.Form("mydir")
    > set fo=fs.GetFolder(mydir)
    > for each x in fo.files
    > Response.write(x.Name & "<br />")
    > next
    > set fo=nothing
    > set fs=nothing
    > %>
    >
    >
    > any ideas? please advise. thanks!!
    >
    >




    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Sep 30, 2005
    #2
    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. TJS
    Replies:
    1
    Views:
    503
    Eliyahu Goldin
    Jun 23, 2004
  2. UJ
    Replies:
    2
    Views:
    347
  3. lalit
    Replies:
    14
    Views:
    1,186
    lalit
    Jun 14, 2007
  4. Replies:
    1
    Views:
    168
    Evertjan.
    Sep 30, 2005
  5. Jim Ley
    Replies:
    3
    Views:
    198
Loading...

Share This Page