Use the following code snippet to list all files from a particular directory,
<cfdirectory action="LIST" directory="#ExpandPath('docs')#" name="dirlist">
<cfloop query="dirlist">
#dirlist.name#
(#NumberFormat(outSize)# kB,
#lsdateformat(dirlist.dateLastModified, 'dddd d mmmm yyyy')#)
</cfloop>
Here "ExpandPath()' returns a absolute URL of the directory.
Use "dirlist.size" to get the filesize.
No comments:
Post a Comment