Click to See Complete Forum and Search --> : View all the folders and files in a server with ASP
How can I write down a simple APS page that I can upload to my server and it'll show me all the folders i have with the files in it. Like FTP. That's all I'm trying to do.
It is possible?
Does anyone know where I can see an example of something like it?
Thanks!
buntine
05-06-2005, 12:43 AM
You need to use the FileSystem Object. See here: http://www.w3schools.com/asp/asp_ref_filesystem.asp
Regards.
Thanks buntine.
Now I have this code:
<%
Sub OneFolder( fldr, indent )
Dim subf, fil
For Each subf In fldr.SubFolders
Response.Write indent & "+ <a href=""" & subf.Name & """>" & subf.Name & "</a><br/>" & vbNewLine
OneFolder subf, indent & " "
Next
For Each fil In fldr.Files
Response.Write indent & "- <a href=""" & fil.Name & """>" & fil.Name & "</a><br/>" & vbNewLine
Next
End Sub
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
OneFolder FSO.GetFolder( Server.MapPath(".") ), ""
%>
What I'm trying to do is simple. I'm trying to make it that way that the link to the file itself will give me the foldername before it. Like that:
mydomain.com/images/logo.jpg
Now I'm gettin'
mydomain.com/logo.jpg
How can I do it?
off hand i think theres a .path property. see what that gives you back.