Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIR listing in ASP

Status
Not open for further replies.
May 12, 2002
51
US
I am looking for a script.. I have a directory called FTP, with several different sub directories.. I want a page that will display them directories in a pretty format.. file name, size, date, type and graphic for each file.

any idea's? Thanks!
-JusTin
 
I haven't done any ASP for ages but this may give you something to build on...

<%
Dim fso, fldr, files, file, thing, subfldrs, subfldr, folderspec
folderspec = &quot;C:\Something&quot;

Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
listfolders
listfiles

sub listfolders
Set fldr = fso.GetFolder(folderspec)
Set subfldrs = fldr.SubFolders
Response.Write &quot;<p>&quot;
For Each subfldr In subfldrs
Response.Write subfldr.name & &quot;<br>&quot;
Next
Response.Write &quot;</p>&quot;
end sub

sub listfiles
Set fldr = fso.GetFolder(folderspec)
set files = fldr.files
Response.Write &quot;<p align=center>&quot;
For Each file In files
Response.Write file.name & &quot;<br>&quot;
Next
Response.Write &quot;</p>&quot;
end sub

%>

Hope this helps. [smurf]
01101000011000010110010001110011
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top