Forum Moderators: open
I got it working first time :)
Is there an asp code to show the file size of each file displayed?
This is my code - exactly the same as in the post:
--
<%
Dim objFSO, objFile
Dim sMapPath, objFolder
'Create File System Object to get list of files
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get The path for the web page and its dir, change this setting to
view different directories!
sMapPath = server.mapPath("./.") ' this means the current directory
'Set the object folder to the mapped path
Set objFolder = objFSO.GetFolder(sMapPath)
' Then for each file in the object we loop through and print the file
and when it was last modified
For Each objFile in objFolder.Files
' Print out a link to the file
Response.Write "<tr><td><a href=""nasheeds/&objFile.Name&"">"
Response.write objFile.Name &" </a></td><td> "&
objFile.DateLastModified ' the file name and its date
Response.write "</td><br></tr>" ' close the tags
Next ' Loop back
' Clear the objects
Set objFSO = Nothing
Set objFolder = Nothing
%>
--
I am not too keen on programming but I really wanted something simple to implement and this worked first time :)