View Full Version : Directory listing in asp
Hi there
is there a way to show the contents of a folder in a .asp page.
I have set a aspload page and i want to set up a page that will show whats been uploaded into the folder.
is there any way of doing this in asp so i can display the info within a page with the same look as the rest of the site.
any suggestions welcome:confused: :confused:
sticky
http://www.codingforums.com/showthread.php?s=&threadid=8736
whammy
03-07-2003, 01:31 AM
Does that help? I would look at the post by brainjar, especially... ;)
I downloaded the file in the zip with the icon graphics which was help full.
one question is there any way to get the server.mappath that shows the folder and the root folder to show url's rather than the drive path of my server.
CURRENT
DIRECTORY IS: <%= uCase(Server.MapPath("."))%></B></FONT><BR> <FONT FACE="ARIAL" SIZE="-2"><B>PARENT FOLDER: <A HREF="../"><%=objFolder.ParentFolder%>.....</A></B></FONT> <P> <FONT FACE="TAHOMA" SIZE="-2"><B>FOLDERS:</B></FONT>
this is the code which displays
CURRENT DIRECTORY IS:_ D:\websites\site\www\pages\
PARENT FOLDER:_D:\websites\site\www\.....
FOLDERS:
what i would like is
CURRENT DIRECTORY IS:_http:\\www.mysite.do.da\pages\
PARENT FOLDER:_http:\\www.mysite.do.da\.....
FOLDERS:
any sugestion
i think that the easiest way to solve this, is a sort of replace.
put the filename in a variable. then first chop of the part of the path that points to your virtual folder
and then have your app's name and stick the path to it. Like this
dim filename, basicname
filename= ...
basicname = right(filename, Len(filename)-20) 'if the path to the app-root contains 20 caracter)
basicname= "http://myapp.com/" + basicname
basicname=server.URLEncode(basicname)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.