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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP / Folders

Status
Not open for further replies.

aspphp

IS-IT--Management
Dec 15, 2009
12
0
0
YE
I put this request in php, I could not figure out. I am requesting ASP champs to help with code or examples.

First I want to display 'folders'like,

/inetpub//inetpub/

once I click on folderOne, I want to display ('subfolder' if any), all that folder files with 'href' link. Once I click on this url, I want to bring that page up.

So on with folderTwo, and other folders. Want to do this
in ASP/ FSO.

Thank you in advance.
 
First I want to display 'folders'like,

"display" where - on the screen?

Sorry, don't quite understand what you are trying to do, perhaps show some code you've already written and maybe someone can help.




--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
this shows q&d the folders and files in one folder:
Code:
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("./"))
response.Write "<b>Folders</b>:<br>"
For Each objItem In objFolder.SubFolders
 %>
 <a href="<%= strPath & objItem.Name %>"><%= objItem.Name %><br />
 <%
Next
response.Write "<hr><b>Files</b>:<br>"
For Each objItem In objFolder.Files
%>
 <a href="<%= strPath & objItem.Name %>"><%= objItem.Name %><br />
<%
Next
Set objItem = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
%>



if you name the file with this code eg default.asp, and copy it into every folder, then you can browse your folder tree...

 
sorry: i forgot
Code:
</a>
after
Code:
<%= objItem.Name %>
 
in order not to duplicate the code you should create default.asp's with only 1 include line, eg like this:
Code:
<!--#inlude virtual="\shared\dirlist.asp" -->


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top