VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Display a Server-side Directory

by S. de Vreede (1 Submission)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Tue 30th October 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Display a Server-side Directory

Rate Display a Server-side Directory



'########################################################
'   Script: Display a directory
'   Author: S. de Vreede
'
'   E-mail: [email protected]
'   Date: 30 October 2001
'########################################################
%>

<html>
<head>
<title></title>
</head>

<body>

<%
dim strPathInfo, strPhysicalPath
dim objFSO, objFile, objFileItem, objFolder, objFolderContents
strPathInfo = request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)

set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.getfile(strPhysicalPath)

set objFolder = objFile.ParentFolder
set objFolderContents = objFolder.Files
%>

<table cellpadding=5>
<tr align=center>
<th align=left>File Name</th>
<th align=left>File Size</th>
<th align=left>File Type</th>
<th align=left>Date Created</th>
</tr>
<%
for each objFileItem in objFolderContents
response.write("<tr><td align=left>")
response.write("<a href='" & objFileItem.Name & "'>" & objFileItem.Name & "</a>")
response.write("</td><td align=right>")
response.write(objFileItem.Size)
response.write("</td><td align=right>")
response.write(objFileItem.Type)
response.write("</td><td align=right>")
response.write(objFileItem.DateCreated)
response.write("</td></tr>")
next
%>
</table>
</body>
</html>


Download this snippet    Add to My Saved Code

Display a Server-side Directory Comments

No comments have been posted about Display a Server-side Directory. Why not be the first to post a comment about Display a Server-side Directory.

Post your comment

Subject:
Message:
0/1000 characters