|
Home > Archive > IIS ASP > September 2005 > show all files in the directory, but how to show directory control??
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
show all files in the directory, but how to show directory control??
|
|
| strutsng@gmail.com 2005-09-30, 2:50 am |
| 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!!
| |
| Evertjan. 2005-09-30, 2:50 am |
| 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)
|
|
|
|
|