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

S

strutsng

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!!
 
E

Evertjan.

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]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top