navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

listing folder contents in a browser

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Server Issues >> listing folder contents in a browser
Page: [1]
 
nickhurd

 

Posts: 36
Joined: 1/26/2002
From:
Status: offline

 
listing folder contents in a browser - 3/14/2005 18:08:13   
I'm running a windows server and trying to give a user permissions to see the contents of a folder. Something like www.site.com/folder

Is there any way to make only that folder browsable? Permissions at the folder level don't seem to work. I get access forbidden even if I'm loggin in on the administrator account

I don't want the entire site to be browsable.

Thanks,
Nick Hurd
Litening Software
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: listing folder contents in a browser - 3/14/2005 19:57:34   
Nick

Windows OS Version? IIS? Apache? Xitami?

Using ASP, PHP, CFM? etc etc

We need more details to give you an answer

_____________________________




(in reply to nickhurd)
nickhurd

 

Posts: 36
Joined: 1/26/2002
From:
Status: offline

 
RE: listing folder contents in a browser - 3/15/2005 17:45:08   
I didn't give quite enough information, did I.

Windows 2003 Web Server. Asp is available.

(in reply to Giomanach)
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: listing folder contents in a browser - 3/15/2005 19:40:15   
OK, create an ASP page, with this in it:

<%
'Putting this file into a directory and calling it will list all the files in the directory as text links with
'relative paths
dim FileExt(3)
dim AbsolutePath
dim Max
'FileExt Holds File Extension, to add new file ext write
'FileExt(4)="gif"
'then change the array dim stat. to 4 and etc...
FileExt(0)="txt"
FileExt(1)="htm"
FileExt(2)="html"
FileExt(3)="asp"
Max=UBound(FileExt)
AbsolutePath = Server.MapPath ("/")
ShowFolderList AbsolutePath

Sub ShowFolderList(FldPath)
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(FldPath)
Set sf = f.SubFolders
For Each f1 in sf
s = FldPath & "\" & f1.name
ShowFiles s
Next
End sub

Sub ShowFiles(path)
dim fs,Dir,n,file
set fs=server.CreateObject("Scripting.FileSystemObject")
Set Dir=fs.GetFolder(path & "\")
for each file in dir.files
for n= 0 to Max
if Right(file,len(FileExt(n)))=FileExt(n) then
MakeLink file
end if
next
next
ShowFolderList path
end sub

Sub MakeLink(path)
dim Link
path=Mid(path,Len(AbsolutePath)+1)
path=Replace(path,"\","/",1)
file=path
link="<a href=" & chr(34) & file & chr(34) & " title=" & file & ">" & file & "</a><br>"
Response.Write link
end sub
%>


That will should list the files, and provide a link to each of them.

HTH

Dan

_____________________________




(in reply to nickhurd)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: listing folder contents in a browser - 3/23/2005 11:25:10   
I posted a similar solution on this thread:

http://www.frontpagewebmaster.com/m-258796/tm.htm

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Giomanach)
Page:   [1]

All Forums >> Web Development >> Server Issues >> listing folder contents in a browser
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts